Smart Nora

Moderator: leecollings

manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Smart Nora

Post by manjh »

FireWizard wrote: Thursday 29 April 2021 8:50 Hello Hans, @manjh

Good to hear it, obviously a Google problem.

Regards
Obviously, but it was triggered by the move to SMart Nora... :o
Hans
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Smart Nora

Post by Gravityz »

the thing is that the google on your sonos/google home is not always the same as the one on your phone.

i have had several times that i give a verbal command, it is picked up by both sonos and phone but google reacts differently

maybee the config sync works better on the phone than it does on the google home/sonos.
edwin1234
Posts: 249
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Smart Nora

Post by edwin1234 »

I have also problems ,with voice control and switching,
If i do voice control the node red switches in the flow are changing but the real lights dont
The same when i switch my lights in google home
Lights only goes on and off with domoticz.

I did delete smart nora and add it again a few times but nothing helps.

Can some one help?
Thanks.
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Smart Nora

Post by Gravityz »

Hi Edwin,

i think your problem is between node-red and domoticz

you need to make sure that if a nora switch changes in node red this command is then send to domoticz through MQTT

in my flow i have a MQTT in node which receives every MQTT message from domoticz
at the end i have a MQTT out node which translates the nora status to a proper MQTT message and sends that out to domoticz
edwin1234
Posts: 249
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Smart Nora

Post by edwin1234 »

Ok,
Could u show your flow?
So i can see how i must adjust it.

Thanks for your help
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Smart Nora

Post by FireWizard »

Hello @edwin1234,

How do you control your lights from Domoticz?
If this is also with MQTT, it is the MQTT loop, that has to be activated.

Regards
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Smart Nora

Post by Gravityz »

here it is.

please note this only works for on/off switches.
If you have dimmers you need to change things and if you have color bulbs also but you get the idea.
i have MQTT prevent loop on tru so i do not think you need the loop, this might cause problems

[{"id":"6665690b.14db68","type":"json","z":"f054f22d.357f2","name":"","property":"payload","action":"","pretty":false,"x":250,"y":360,"wires":[["e30dbeea.95cfd"]]},{"id":"e30dbeea.95cfd","type":"switch","z":"f054f22d.357f2","name":"Switch or Dimmer","property":"payload.switchType","propertyType":"msg","rules":[{"t":"cont","v":"On/Off","vt":"str"},{"t":"eq","v":"Dimmer","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":440,"wires":[["1d85b732.bcbef9"],[]],"outputLabels":["Switch","Dimmer"]},{"id":"1d85b732.bcbef9","type":"function","z":"f054f22d.357f2","name":"On/Off","func":"msg.topic = msg.payload.idx;\nmsg.name = msg.payload.name;\nif (msg.payload.nvalue === 1)\n{\n msg.payload = true;\n}\nelse if (msg.payload.nvalue === 0)\n{\n msg.payload = false;\n}\n return msg;","outputs":1,"noerr":0,"x":490,"y":360,"wires":[["967d2ad2.543b68"]]},{"id":"967d2ad2.543b68","type":"switch","z":"f054f22d.357f2","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"335","vt":"str"},{"t":"eq","v":"77","vt":"str"},{"t":"eq","v":"208","vt":"str"},{"t":"eq","v":"317","vt":"str"},{"t":"eq","v":"201","vt":"str"},{"t":"eq","v":"3","vt":"str"},{"t":"eq","v":"9","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":670,"y":360,"wires":[[],["2ef621d.53d9ade"],["47e77b76.ef57a4"],["7283506f.a453d"],["9ef26217.759c6"],[],[]]},{"id":"853cd08.4dd6a3","type":"function","z":"f054f22d.357f2","name":"On/Off","func":"var idx = parseInt(msg.topic);\nif ( msg.payload === true )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"On\" };\n}\nelse if ( msg.payload === false )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Off\" };\n}\nreturn msg","outputs":1,"noerr":0,"x":1150,"y":300,"wires":[[]]},{"id":"ebe628eb.a51a28","type":"mqtt in","z":"f054f22d.357f2","name":"","topic":"domoticz/out","qos":"0","datatype":"auto","broker":"13be388d.261547","x":230,"y":240,"wires":[["6665690b.14db68"]]},{"id":"7e9e473a.d90818","type":"comment","z":"f054f22d.357f2","name":"Aan/Uit lampen","info":"","x":460,"y":300,"wires":[]},{"id":"9ef26217.759c6","type":"noraf-switch","z":"f054f22d.357f2","devicename":"Tuin sproeier","roomhint":"Achtertuin","name":"Tuinsproeier","passthru":false,"nora":"5705755.560e78c","topic":"201","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":910,"y":420,"wires":[["853cd08.4dd6a3"]]},{"id":"2ef621d.53d9ade","type":"noraf-light","z":"f054f22d.357f2","devicename":"Tuin lampen","lightcolor":false,"brightnesscontrol":false,"commandonlycolor":false,"turnonwhenbrightnesschanges":false,"passthru":false,"statepayload":true,"brightnessoverride":"","roomhint":"Achtertuin","name":"tuinlampen","colortype":"hsv","nora":"5705755.560e78c","topic":"77","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","temperaturemin":"2700","temperaturemax":"5500","x":910,"y":240,"wires":[["853cd08.4dd6a3"]]},{"id":"47e77b76.ef57a4","type":"noraf-light","z":"f054f22d.357f2","devicename":"Vitrinekast","lightcolor":false,"brightnesscontrol":false,"commandonlycolor":false,"turnonwhenbrightnesschanges":false,"passthru":false,"statepayload":true,"brightnessoverride":"","roomhint":"Woonkamer","name":"Vitrinekast","colortype":"hsv","nora":"5705755.560e78c","topic":"208","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","temperaturemin":"2700","temperaturemax":"5500","x":910,"y":300,"wires":[["853cd08.4dd6a3"]]},{"id":"7283506f.a453d","type":"noraf-light","z":"f054f22d.357f2","devicename":"Veranda","lightcolor":false,"brightnesscontrol":false,"commandonlycolor":false,"turnonwhenbrightnesschanges":false,"passthru":false,"statepayload":true,"brightnessoverride":"","roomhint":"Achtertuin","name":"Veranda","colortype":"hsv","nora":"5705755.560e78c","topic":"317","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","temperaturemin":"2700","temperaturemax":"5500","x":900,"y":360,"wires":[["853cd08.4dd6a3"]]},{"id":"13be388d.261547","type":"mqtt-broker","name":"MQTT Broker","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"5705755.560e78c","type":"noraf-config","name":"nora config","group":"","twofactor":"off","twofactorpin":"","localexecution":true,"structure":"Thuis"}]
edwin1234
Posts: 249
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Smart Nora

Post by edwin1234 »

Thanks
I will try it with your flow.
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Smart Nora

Post by Gravityz »

you need to use your own nora config node and delete mine if necessary
edwin1234
Posts: 249
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Smart Nora

Post by edwin1234 »

Your flow is the same as mine,it does not work.

My flow did work with old nora but with the new nodes from smart nora it only works in the node red flow.
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Smart Nora

Post by Gravityz »

ok, maybe install MQTT explorer on your pc or MQTT terminal on your ios device

you need top check that if a nora switch changes that the MQTT command is send out and what it looks like.

if there is no correct MQTT command then that is your problem.
if the correct MQTT command is send out to domoticz/in and domoticz is not doing anything with it then that is your problem.

my domoticz build is 12194

i know that they changed things in later builds that you can not see received MQTT commands anymore in the domoticz log.
maybee something else changed
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Smart Nora

Post by FireWizard »

Hello @edwin1234,

I have a few questions.

1. What is your Node Red version?

2. What is your Smart Nora version?

3. What is your setting in Domoticz Hardware for your MQTT hardware regarding "Prevent Loop"?

4. What is your Domoticz version?

Later today I will look to your flow. Is it okay to use @Gravityz flow or do you prefer your own flow?
In that case, can you publish your flow?

Regards
edwin1234
Posts: 249
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Smart Nora

Post by edwin1234 »

I am not at home right now,
Tomorrow i will send my flow.
Node red domoticz and smart nora are the latest version.
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Smart Nora

Post by Gravityz »

meten is weten.

check what MQTT string is send out and if it is received on channel domoticz/in use mqtt explorer)

most of the time when i have things working in node-red and they stop after an update it is because they changed something from less picky to picky

eg things which worked before(even if th syntacs is not 100% correct) could stop working when they update node-red

i am on smart nora 1.0.11 and nodered 1.3.3
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Smart Nora

Post by FireWizard »

Hello @edwin1234,
Node red domoticz and smart nora are the latest version.
In this case, we are on the same level.

Node Red: version 2.0.5
SmartNora: version 1.3.1

The versions of @Gravityz are older and therefore I have been able to simplify the flows.

I created a flow with the devices of @Gravityz. Thanks for that.

Screenshot_SmartNora_lights.png
Screenshot_SmartNora_lights.png (29.77 KiB) Viewed 1835 times

If you configure your MQTT Input node to what you expect, you do not need the JSON node to convert the message.
Choose the correct format: "a parsed JSON object".

Screenshot_MQTT-IN.png
Screenshot_MQTT-IN.png (18.29 KiB) Viewed 1835 times

Since version 1.0.12 the SmartNora nodes are able to filter on topic. This makes the Switch node obsolete.
But do not forget to tick the box.

Screenshot_SmartNora_node.png
Screenshot_SmartNora_node.png (36.8 KiB) Viewed 1835 times

Please find the complete flow, as shown above, below:

Code: Select all

[{"id":"e30dbeea.95cfd","type":"switch","z":"22f5db58.ab19ec","name":"Switch or Dimmer","property":"payload.switchType","propertyType":"msg","rules":[{"t":"cont","v":"On/Off","vt":"str"},{"t":"eq","v":"Dimmer","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":4080,"wires":[["1d85b732.bcbef9"],[]],"outputLabels":["Switch","Dimmer"]},{"id":"1d85b732.bcbef9","type":"function","z":"22f5db58.ab19ec","name":"On/Off","func":"msg.topic = msg.payload.idx.toString();\n\nif (msg.payload.nvalue === 1) {\n    msg.payload = true\n}\nelse if (msg.payload.nvalue === 0) {\n    msg.payload = false\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":4080,"wires":[["2ef621d.53d9ade","47e77b76.ef57a4","7283506f.a453d","9ef26217.759c6"]]},{"id":"853cd08.4dd6a3","type":"function","z":"22f5db58.ab19ec","name":"On/Off","func":"var idx = parseInt(msg.topic);\nif ( msg.payload === true )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"On\" };\n}\nelse if ( msg.payload === false )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Off\" };\n}\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":990,"y":4080,"wires":[[]]},{"id":"7e9e473a.d90818","type":"comment","z":"22f5db58.ab19ec","name":"Aan/Uit lampen","info":"","x":420,"y":4020,"wires":[]},{"id":"9ef26217.759c6","type":"noraf-switch","z":"22f5db58.ab19ec","devicename":"Tuin sproeier","roomhint":"Achtertuin","name":"Tuinsproeier","passthru":false,"errorifstateunchaged":true,"nora":"5705755.560e78c","topic":"201","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","twofactorpin":"","filter":true,"asyncCmd":false,"outputs":1,"x":810,"y":4160,"wires":[["853cd08.4dd6a3"]]},{"id":"2ef621d.53d9ade","type":"noraf-light","z":"22f5db58.ab19ec","devicename":"Tuin lampen","lightcolor":false,"brightnesscontrol":false,"commandonlycolor":false,"turnonwhenbrightnesschanges":false,"passthru":false,"errorifstateunchaged":true,"statepayload":true,"brightnessoverride":"","roomhint":"Achtertuin","name":"tuinlampen","colortype":"hsv","nora":"5705755.560e78c","topic":"77","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","temperaturemin":"2700","temperaturemax":"5500","twofactorpin":"","filter":true,"x":810,"y":3980,"wires":[["853cd08.4dd6a3"]]},{"id":"47e77b76.ef57a4","type":"noraf-light","z":"22f5db58.ab19ec","devicename":"Vitrinekast","lightcolor":false,"brightnesscontrol":false,"commandonlycolor":false,"turnonwhenbrightnesschanges":false,"passthru":false,"errorifstateunchaged":true,"statepayload":true,"brightnessoverride":"","roomhint":"Woonkamer","name":"Vitrinekast","colortype":"hsv","nora":"5705755.560e78c","topic":"208","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","temperaturemin":"2700","temperaturemax":"5500","twofactorpin":"","filter":true,"x":810,"y":4040,"wires":[["853cd08.4dd6a3"]]},{"id":"7283506f.a453d","type":"noraf-light","z":"22f5db58.ab19ec","devicename":"Veranda","lightcolor":false,"brightnesscontrol":false,"commandonlycolor":false,"turnonwhenbrightnesschanges":false,"passthru":false,"errorifstateunchaged":true,"statepayload":true,"brightnessoverride":"","roomhint":"Achtertuin","name":"Veranda","colortype":"hsv","nora":"5705755.560e78c","topic":"317","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","temperaturemin":"2700","temperaturemax":"5500","twofactorpin":"","filter":true,"x":800,"y":4100,"wires":[["853cd08.4dd6a3"]]},{"id":"75cbfb4601992e30","type":"mqtt in","z":"22f5db58.ab19ec","name":"MQTT In","topic":"domoticz/out","qos":"2","datatype":"json","broker":"f9f13036.e28b58","nl":false,"rap":true,"rh":0,"x":220,"y":4080,"wires":[["e30dbeea.95cfd"]]},{"id":"5705755.560e78c","type":"noraf-config","name":"nora config","group":"","twofactor":"off","twofactorpin":"","localexecution":true,"structure":"Thuis"},{"id":"f9f13036.e28b58","type":"mqtt-broker","name":"localhost","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]
At the output, you can connect a MQTT out node, with the topic domoticz/in and in parallel a Debug node.
Check at that node, if the format of the message to Domoticz is correct.
Check also with MQTT Explorer, as suggested by @Gravityz.

Let us know the result.

Best regards.
edwin1234
Posts: 249
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Smart Nora

Post by edwin1234 »

Tried the flow , and lights goes on and off perfectly,
Thank you very much.
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Smart Nora

Post by Gravityz »

i updated nodered to 2.0.5 and voice commands are still working

tomorrow i will upgrade the nora nodes to see if they stop working when controlled by voice. if they do then the problem probably was in the 2 json nodes.

with the old versions they were needed but with the new nodes they might screw up an already correct string.
I will let you guys know the outcome.

i have had similar problems with the color light nodes in the past.
after an upate they stopped working because some tiny things changed in the code
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Smart Nora

Post by Gravityz »

updated everything and my setup is still working, including the now obsolete json and switch nodes
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Smart Nora

Post by FireWizard »

@Gravityz,

I expected that, as the flow did not change significantly.

The JSON conversion is now moved to the MQTT input node.
The filtering is moved to the SmartNora node.

But in principle it is the same.

I think that we will never know, what the problem of @edwin1234 was.

A tip:

You have NR version 2 installed have a look to the new Debug and Linter features.

Regards
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Smart Nora

Post by Gravityz »

ok thanks, will look at it.
regarding the new functionality in the smartnora nodes to filter out topics.

my guess is that when you use this functionality it will create a lot of workload on nora since every nodes gets multiple communication strings

If i leave the switch in place this will reduce this workload a lot
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest