stfnhmplr / node-red-contrib-homee

access the homee api with node-red
37 stars 8 forks source link

fix bad diagrams in homee caused by not sending repeated values #5

Closed DanielKnoop closed 4 years ago

DanielKnoop commented 4 years ago

I described my problem in the homee community forum and fixed my problem with the diagrams by removing the check , that prevent sending the same value again to homee. With this patch all my diagrams are fine now.

https://community.hom.ee/t/mal-wieder-virtuelle-geraete-jetzt-aber-richtig/24831/426

stfnhmplr commented 4 years ago

Thanks for your contribution.

I understand the need. But I didn't add the condition without a reason. I would like to prevent homee from being spammed by double messages. This could lead to a crash.

I think it would be better to allow a change only once per minute. Therefor the timestamp of the last change must be taken into account. What do you think?

SteffenTM commented 4 years ago

For my opinion i would not do the repeat with the hih-Node. I think the hih-Node shouldn't send messages if it's not necessary If it's necessary for any reason, it can be used the repeat-Node as own needs.

DanielKnoop commented 4 years ago

Yes, the hih node should not repeat an old message by himself. But currently, the hih node absolutly prevent to send the same value again and again. And this is important to get nice diagrams. So I removed the check in this PR. To prevent homee to get flooding with unwanted messages, @stfnhmplr suggest not completly remove the check but add a minimal time for this. This is a good point. I thinks a few seconds (10-20?) should be enough for this. In general I think the user should know what he do.

stfnhmplr commented 4 years ago

I've implemented the discussed variant. After 10 seconds the same value can be sent again. So I close this PR.

DanielKnoop commented 4 years ago

Thanks, you got coffee