Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving custom setting from device #457

Open
tripflex opened this issue Dec 22, 2017 · 7 comments
Open

Saving custom setting from device #457

tripflex opened this issue Dec 22, 2017 · 7 comments
Assignees
Milestone

Comments

@tripflex
Copy link
Contributor

As mentioned in my other issues/comments, I have a custom node that relies on a custom config value that is stored by Homie.

The issue is that, I also have exposed this setting in a node property, to allow configuring that one property via MQTT, but can't find any way to save a custom setting value (without using incremental json to do so).

Is there no way to set a custom setting value and have that save to the config file ... from inside my code base? IF not, i'll just have to use a lib I created from my old project to save json values to a file ... would just be nicer to be able to save that value in the same homie config to not have to use multiple configuration files.

Case and point, I have a RelayNode (which controls a pump), and I have a custom setting setup for runDuration ... this runDuration is also exposed as a property of the node, ie:
/homie/test-device/pump/duration which is settable, and when that value is set, I need it to update the runDuration saved to the HomieConfiguration, that way that value that was set is used instead of the default value.

Yes when the device connects back via MQTT and it subscribes it will receive the last set value, but if the device does not have internet, I still need it to be able to run and use the last set value, thus, the reason I need to be able to save the value to the configuration.

Is this something that would be possible already with the existing Homie codebase, or do I need to just go ahead and setup another way to handle saving my own custom configurations?

@timpur timpur self-assigned this Dec 22, 2017
@timpur timpur added this to the v2.1.0 milestone Dec 22, 2017
@timpur timpur mentioned this issue Dec 22, 2017
17 tasks
@timpur
Copy link
Contributor

timpur commented Dec 23, 2017

Im working on alot to enable using settings better with homie, ill add this to the list ( #458 )

@tripflex
Copy link
Contributor Author

@timpur awesome 👍 thank you!!

timpur added a commit to timpur/homie-esp8266 that referenced this issue Dec 29, 2017
@timpur
Copy link
Contributor

timpur commented Dec 29, 2017

Added this to my fork. You can test it if you like

@tripflex
Copy link
Contributor Author

Yup I noticed that, i've actually been using your 2.1 branch fork for a while now, haven't had a chance to test this part yet, but will do so here this weekend and let you know

@timpur
Copy link
Contributor

timpur commented Jan 20, 2018

@tripflex
Awsome, on hols for a week so will be smashing out some homie stuff while I have a bit more time... So report issues to me if they arise about V2.1

@tripflex
Copy link
Contributor Author

@timpur will do .. is the plan to keep the /wifi/connect as POST? Reason I ask I create a Meteor plugin to handle Homie API (and anything else I can add later) and noticed you changed it to POST in your fork:
https://github.com/tripflex/meteor-homie

@timpur
Copy link
Contributor

timpur commented Jan 20, 2018

Yes, I believe put should be for putting a file on the server and not setting a setting. So I think post makes more sense here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants