💬 Relay
-
Hello everybody !
I would like to creat a sensor with two relays and two buttons to command this relay direct from the sensor (with actualisation of their stat in domoticz)
Someone know the code to do this ? I'm a complete newbie on mysensor !Thank's a lot !
-
Hello everybody !
I would like to creat a sensor with two relays and two buttons to command this relay direct from the sensor (with actualisation of their stat in domoticz)
Someone know the code to do this ? I'm a complete newbie on mysensor !Thank's a lot !
-
Excellent ! It's perfect, thank's a lot rejoe2 !
-
Hi
Using Home assistant, and Optimistic set to false in the mysensors config, the switch in homeassistant would turn the relay on, but in the view in homeassistant the flip switch jumped off straight after switching on. It was solved by adding the following line to the sketch, ensuring that hassio knows that the actuator actually have received the command. Not sure if this is a good way of doing it, but it seems to work for me.
send(msg.set(state)); // Send new state and request ack back
in:
void receive(const MyMessage &message) {
// We only expect one type of message from controller. But we better check anyway.
if (message.isAck()) {
Serial.println("This is an ack from gateway");
}if (message.type == V_LIGHT) {
// Change relay state
state = message.getBool();
digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);
// Store state in eeprom
saveState(CHILD_ID, state);// Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); send(msg.set(state)); // Send new state and request ack back}
}Thanks
-
Hi!
I would like to control some 230VAC equipment (for now roller shutters), based on inputs from my mysensors sensors (temperature and light). For controller I use domoticz.
I would like a safe, robust and preferably authorized/lawful solution (I'm in EU/Denmark).
I came across the following solutions:
https://aeotec.com/z-wave-plug-in-switch
https://sonoff.itead.cc/en/products/sonoff/sonoff-basic
https://dlidirect.com/products/iot-power-relayI think the first one and maybe the second one will be authorized/lawful...? However, I have experience only with mysensors and neither z wave nor sonoff...
Anyone has some experience/thoughts/suggestions to share?
Thanks.
-
There are also roller shutters nodes running via zwave if you are looking at a retail solution
Thank you @gohan! Retail solution is not the keyword here. What I am searching for is an authorized/lawful (safe) solution.
I decided to do my own node (mysensors) with a cheap relay module for the arduino. Once I achieve the desired functionality I will change to some more robust hardware. Following your suggestion this could be a z wave roller shutter (e.g. fibaro or qubino).
-
Thank you @gohan! Retail solution is not the keyword here. What I am searching for is an authorized/lawful (safe) solution.
I decided to do my own node (mysensors) with a cheap relay module for the arduino. Once I achieve the desired functionality I will change to some more robust hardware. Following your suggestion this could be a z wave roller shutter (e.g. fibaro or qubino).
@arrawx said in 💬 Relay:
Retail solution is not the keyword here. What I am searching for is an authorized/lawful (safe) solution.
Sorry to comment negative, but your wording doesn't make sense. either you will go for a DIY solution, cheap and illegal (but not necessary a bad solution), or you will purchase a retail solution.
Retail solution must have the required certificates to allow you to sell. Those are not cheap to get, which also provide the reason for a retail solution to
be usually fairly expensive
https://arbejdstilsynet.dk/da/regler/bekendtgorelser/i/sam-indretning-af-tekniske-hjaelpemidler-612And also you need Notified Body
https://en.wikipedia.org/wiki/Notified_BodyAnd I know that Cetekom can create certificate for Country Approvals
https://www.cetecom.com/en/certification/country-appoval/ -
There is a problem with the example code for RelayActuator.ino It is not checking for ACK messages. See the other example called SecureActuator.ino that does this. Without checking for ACK messages my relay gets an ON signal and turns on then immediately thereafter gets an ACK signal for V_STATUS command which is assumed in this example to be a control and the value is "0" so it turns off the relay.
-
There is a problem with the example code for RelayActuator.ino It is not checking for ACK messages. See the other example called SecureActuator.ino that does this. Without checking for ACK messages my relay gets an ON signal and turns on then immediately thereafter gets an ACK signal for V_STATUS command which is assumed in this example to be a control and the value is "0" so it turns off the relay.
@slt1 I'm not sure I'm following. RelayActuator.ino does not send any messages, so it should never receive any ack messages. Compare with RelayWithButtonActuator.ino which does send messages, and therefore also checks for ack.
Could you elaborate on the problem?
-
@slt1 I'm not sure I'm following. RelayActuator.ino does not send any messages, so it should never receive any ack messages. Compare with RelayWithButtonActuator.ino which does send messages, and therefore also checks for ack.
Could you elaborate on the problem?
For some reason I am now unable to reproduce the issue on the standard RelayActuator.ino example. It was definitely sending ACK requests when I was testing a few days ago. I have subsequently updated MySensors library and also MyController to their latest Snapshot - so perhaps the issue comes up under one of those scenarios.
The issue around this though is that the example does not report the current status of the relay in the loop. My own sketch was doing so. I guess many people take an example and modify it like I do. Therefore copying the example and adding in the code to send the current relay status periodically means the receive function will not work properly due to the Ack messages received,
I would then suggest adding a note to the receive function of the relay example sketch to say that "if your node sends messages then you need to check for Ack and discard those messages" - or something along those lines. This will help !
-
For some reason I am now unable to reproduce the issue on the standard RelayActuator.ino example. It was definitely sending ACK requests when I was testing a few days ago. I have subsequently updated MySensors library and also MyController to their latest Snapshot - so perhaps the issue comes up under one of those scenarios.
The issue around this though is that the example does not report the current status of the relay in the loop. My own sketch was doing so. I guess many people take an example and modify it like I do. Therefore copying the example and adding in the code to send the current relay status periodically means the receive function will not work properly due to the Ack messages received,
I would then suggest adding a note to the receive function of the relay example sketch to say that "if your node sends messages then you need to check for Ack and discard those messages" - or something along those lines. This will help !
-
For some reason I am now unable to reproduce the issue on the standard RelayActuator.ino example. It was definitely sending ACK requests when I was testing a few days ago. I have subsequently updated MySensors library and also MyController to their latest Snapshot - so perhaps the issue comes up under one of those scenarios.
The issue around this though is that the example does not report the current status of the relay in the loop. My own sketch was doing so. I guess many people take an example and modify it like I do. Therefore copying the example and adding in the code to send the current relay status periodically means the receive function will not work properly due to the Ack messages received,
I would then suggest adding a note to the receive function of the relay example sketch to say that "if your node sends messages then you need to check for Ack and discard those messages" - or something along those lines. This will help !
@slt1 sending current status won't generate an ack/echo message. So there should not be a need to handle the ack/echo flag. Hardware acks (which are enabled by default) do not trigger the receive function.
The only case when an ack/echo message will be sent is if the sketch developer explicitly requests an ack/echo by setting the ack parameter in send() to true. If the sketch developer does that, they need to handle the ack/echo message inside the receive function, according to however they plan to handle the ack/echo message.
My guess is that people set the ack flag to true without understanding what they are doing. I hope to make the documentation slightly less confusing by doing https://github.com/mysensors/MySensors/issues/1103
-
@slt1 sending current status won't generate an ack/echo message. So there should not be a need to handle the ack/echo flag. Hardware acks (which are enabled by default) do not trigger the receive function.
The only case when an ack/echo message will be sent is if the sketch developer explicitly requests an ack/echo by setting the ack parameter in send() to true. If the sketch developer does that, they need to handle the ack/echo message inside the receive function, according to however they plan to handle the ack/echo message.
My guess is that people set the ack flag to true without understanding what they are doing. I hope to make the documentation slightly less confusing by doing https://github.com/mysensors/MySensors/issues/1103
@mfalkvidd Thanks - and yes - I did make the assumption that send with ack = true means do a hardware ack. I was unaware that a "software ack" also exists. I read your comment here : https://forum.mysensors.org/topic/3346/discussion-reliable-delivery/17 and what you mention there needs to be made loud and clear in the docs - perhaps some mention in both the message send function and message receive function,
-
@mfalkvidd Thanks - and yes - I did make the assumption that send with ack = true means do a hardware ack. I was unaware that a "software ack" also exists. I read your comment here : https://forum.mysensors.org/topic/3346/discussion-reliable-delivery/17 and what you mention there needs to be made loud and clear in the docs - perhaps some mention in both the message send function and message receive function,
-
-
This post is deleted!
-
I am having this particular switch to be recognized in "Mozilla WEBTHINGS".
IS there some issue with having a repeater node and sensors/switches etc attaches to it? .. it sends in the data as it should when I check with MYSController and I can switch it from there with sending "V_STATUS" messages. but no luck so far of getting the sensors appear in WEBTHINGS , every other sensor works fine.