Absolute humidity chart
Well I have some sensors now and a task for them. I would like calculate absolute humidity and display as chart. Well assume I have the math so the question is.
Can I show the results (multiple) in on dashboard as chart ?
Next I would like to replace my switch (on dashboard) driving relay with fan to compare absolute humidities and do this automatically (to get the moisture out). Is also this possible in mycontroller ? Some examples?
@jan2son Firstly welcome to the MyController world !
Yes you can diaplay any values on a chart in mysensors. I recently posted my weather monitoring setup page (well one of them!), see it here.....
Whilst it is common for many to send data to the controller, have the controller make a decison and then send out messages to the node to fulfill a desired result, you have to consider what would happen if the controller or gateway failed or was unavailable for any reason.
Personally I put as much decision making in the node itself and send the data to the controller to tell it what is happening. I also use the controller to send data to the nodes. Too much reliance on the controller will increase radio traffice resulting in more packet collisions and more re-tries. I prefer it if nodes carried on working regardless of if a gateway or controller is available. You may want something different!
You can probably replace your switch with a suitably rated realy without any problems.
So in your situation I would approach it like this.
- Have the node get and calculate the absolute humidity.
- Have the node send Absolute Humidity value to the controller for graph.
- Have the node decide if the fan is on or off.
- Have the node turn on/off the fan depending on the requirements.
- Have the node send fan status to the controller.
- Have the node listen to the controller messages so that you can manually turn on/off the fan whenever you want.
Hello @skywatch, thank you for kind response. It was nice!
What helped me a lot was hierarchical approach. The idea make nodes simple and do only simple tasks. The gateway works in the same style and this is the reason why it is so easy and powerful.
You mentioned error handling. I met this question already with node rx - nodes do not listen continuously because of rx power is high (I am expecting battery powered nodes). So SmartSuspend seems as easy solution for the problem but this seems it can fail. For this reason I would prefer to keep the node's state variable (relay/fan state for example) on the controller side and let the node ask for it. Nodes can send read requests and also knows if they got the value. I could be nice to connect the state value with timestamp to recognize fresh state/reading for example.
Unfortunately absolute humidity decisions are more complex than one node. You need simply more sensors and locations to decide if it worths to change air in a room. It requires 1. outside humidity and temperature, also 2. room temperature and humidity and finally 3. relay/fan node. Make the calculation on the controller makes perfectly sense. Communication problem can be solved on relay by timeout - simply stop.
Regarding calculations on the controller. Is it possible to keep result in a variable
- updated on every update from node (input data)
- which could be source of values for a chart (as common node variables)?
I do see option to run a script on value comparisons which seems promising. Unfortunately I do not option to run it always when new value comes from a node. But this could be possible to hack with for example comparison against impossible value.
I am not java script guy so I do not know what to do with the chart variable Here I need help.
Thank you for reading my problems, I hope this could help others because more data processing and driving nodes is the next step for all. Not only data collecting and viewing them manually on nice interface.
I found the solution with Rule, new Sensor variable, UUID and Script.
I will share the solution soon.
@jan2son That's great news - looking forward to seeing your implementation.