@mhkid perhaps make together a base line and help each other this way?
Posts made by Psilin
-
RE: Started with MySensors and about to give up (some feedback)
-
RE: Started with MySensors and about to give up (some feedback)
@monte @alowhum : the choice I made for OpenHab was based on the open structure which allows connecting different vendor devices by the development of a glue layer, called bindings. A large pre for me is the support of my alarm system, so (in theory) I already have wired sensors that I can use at all my (external) doors and windows. I am really looking for a controller that will fit my needs, and grow with it.
I'm sure Home Assistant and/or Candle (never heard of it before) will also be fine for use with MySensors/MQTT. But is is like selecting a car: multiple vendors will bring you from A to B, most vendors will do the job at a decent speed and reliability. At the same time some people prefer a german car, other people prefer a French brand an so on. In a later post I will explain my selection of OpenHab more in depth.
@scalz @Yveaux @hek @kiesel You all 'voted' or 'liked' my post. So I guess this needs a decent follow up. At what place do you want me to document my struggles? In this thread, or a new thread ? And when a new thread has the advantage, please let me know in what section I should start it!
-
RE: Started with MySensors and about to give up (some feedback)
What an interesting thread this became. Over some time/years ago I tried to start with MySensors. Unfortunately I failed miserably because I tried it to combine with starting with Openhab, and connect mysensors by mqtt.
The Openhab route combined with Mysensors is still the route I want to go: combine the open architecture of Openhab to connect different vendor approaches added with the flexible way of MySensors.
To be complete: My background is a bachelor in Physics. So the basic programming and electronics may not be the real problem, although I am certainly not claiming to know everything.
To end up this post: in the next couple of weeks/months I have spare time to invest in the project. When I combine this with the things the topic starter ave addressed I have the following to offer to the Mysensors community:
“I am offering to write and give feedback of the guides and information found in the forum, to document at what point I am stuck with the given information. I hope the community can and will do something with this feedback. So long as I am not going to be completely stuck, I can and will be writing the feedback.”
Off coarse I need to know if the community is waiting for such an approach before I start to write.
My thoughts of devices to use in the network:
- mqtt gateway: wired based on cloned arduine with hat ethernet
- mqtt gateway based on wifi based esp8266 nodemcu board
- radio network: base the nrf24 version
- radio network: based on rfm69 for secure transmission (opening doors with nrf24 does not feel safe)
- repeaters as needed or extra gateways (3 story concrete house)
- sensors and actuators: starting with wallpowered, later adding battery powered
So, how does this approach sound to you all?
-
RE: Newbie question: how to read status of relay?
I am well aware of the facts that all these wonderful stuff is created by volunteers. If it was not clear: I really want to thank all of the people who made this possible. It is a great and remarkable project.
That said: since I am at the very very ( did I mention very?) early stage of playing with the MySensors, I am not in the position to create, add or edit any content at this moment. But I hope since this all is new to me, that if I find something strange, or something that I cannot find, to mention it. It is not criticism, but a honest view of what a newbie like me faces when starting with the project. Perhaps in a later stage I will try to add/change for example the documentation. But that goal for now are a few yards too far away.
So also,I really want to thank the people who are replying to, perhaps perceived as dumb questions', at this forum. That information really got me some further.
To read the fields used in the serial protocol in the receive function of the node:
serial field format: node id;child_sensor_id;command;ack;type;payload void receive(const MyMessage &message) { //child_sensor_id message.sensor; //command message.getCommand(); //ack message.isAck(); //type message.type; //payload message.getBool(); //in case of variable type boolean }
Regarding using of Sonoff's: I've seen some video's on youtube. It is absolute an incredible featured device with the correct firmware on it. Perhaps in the future I will be using it, but for now I want to focus on the open structure of the mySensors.
Next step is to try to connect a controller mechanism. Because of the fact I want to use only MQTT as transport protocol, mainly to keep things open, I thought of putting MyController and OpenHab together. Primary to use OpenHab as controller ( also my knowledge of this system is about zero), and use MyController only to be able to upload new firmware. After reading the suggested forum threads, I am scared this won't work because of the fact that when a node ask something to the controller, the node would get up to 2 answers. Only the answer of OpenHab should be used, but as far as I know right now there is no filter or selection option possible.
-
RE: Newbie question: how to read status of relay?
Well, the suggested forum thread certainly has valueable information regarding my question. Somehow I think this kind of information should be part of the API description.
I really appreciate the total of Mysensors. It seems like a real solution with high adaption possibilities. The documentation and the given examples unfortuanate are not of the best quality. The learning curve to be able to use the Mysensors solution is therefore quite steep.To the question of what I want to accomplish: I am inspired by the Fibaro solution for a double switch. Were Fibaro puts this sensor/actuator behind the wall switch, I want to place it at the position of the light bulb. For now I am trying to make a proof of concept in software, and the hardware is a junk of breadboard and dupont cables. For a real working node I have to solve also some hardware questions. (Low power AC node, AC sensing signal, footprint size, housing etc)
-
RE: Newbie question: how to read status of relay?
Because there will be a local override. Mainly for not interrupting the normal behaviour of the lights in the house, but with the addition of being controlled by a controller.
To be more specific, imagine the case:
controller light switch on
physical light switch off
light is onand now the physical light switch is used so the physical signal will be high on the wire, and still I want the light be off because of the change of switch position.
So to know the real status of the node output I need to be able to read the output status.
-
Newbie question: how to read status of relay?
Hi,
After reading a lot on this site, I think I understand the serial protocol at least at the basic level. I use the MQTT ethernet gateway sketch, and use only MQTT.FX as client to mosquitto. So for now there is not the complication of a controller in the field.
Now I am trying to alter the Relay Actuator sketch. But investigating this sketch and very much more type of sketches, I don't understand how receiving of messages is handled in the code.I mean, in the Relay Actuator code, this is the relevant code: (hard coded node-id of 250)
void receive(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type==V_STATUS) { // Change relay state digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF); // Store state in eeprom saveState(message.sensor, message.getBool()); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); }
I tested this code with MQTT.FX by sending
mygateway1-out/250/1/1/0/2 with a payload of 1
And then the led which represents the relay is lighted up.
But when I request the value of the relay with:
mygateway1-out/250/1/2/0/2 with a payload of 1
the led is also lightened up. This seams false to me because the command value equals 2 , which stands for request.
So: how can I check in the sketch code not only message.type, but also for the used command?I need this because I want to create a node that can be placed on the normal light points at the ceilings. So that via a variable the actual light can be switched. And therefore I think I need to be able to ask the node to the status of the light.
In the documentation I can see how to read the type (message.type) and the child-sensor-id (message.sensor). But how to get the other variables as mentioned in the serial protocol?
-
RE: 💬 Door, Window and Push-button Sensor
what is the logic of the variable "V_TRIPPED"to use? I just messed a little with the MyController application, and by using the V_TRIPPED the value changes from off to on,and stays on,even if the button is released? ( simular to close an opened door)
Should the variable not be of a binary type with according sensor type? -
RE: Newbee issue: howto set relay node with using MQTT?
Last night I downloaded a mqtt client on my phone. And guess what: first attempt was working directly.
So after I knew at least the node is working, and the topic that I figured out was correct, I returned to mqtt.fx this morning.That was a really facepalm moment. Quite embarrising I must confess......
In mqtt.fx in the publish tab, there is a really great white box right beneath the topic field. And exactly in that great white field I can enter the boolean payload I need.So my help question is answered in the mean time. For now I can continue to explore the mysensors possibilities, and try to let it work together with Openhab. After that, I will look to mycontroller.org to get it glued together by the mqtt layer. Although I’ve read somewere that a pure translation/retransmission between mycontroller to a mqtt broker not seems possible.
-
Newbee issue: howto set relay node with using MQTT?
Hi All,
Today I finally managed to go a bit further with my home automation project. In the future I think to use a combination of OpenHab ( the list of available bindings looks awesome ), and MyController.org because of the possibility to use FOTA.
And after a lot af reading and thinking, I am liking the MQTT broker part as superglue between these controllers and even perhaps in the future some sensors/actuators.But off coarse all projects starts small. So I went on to install a Mosquitto server, created an MQTT ethernet gateway following the description of the build howto on this site. (only the ip addresses, mac address were adapted).
Also I created a basic door/window sensor ( fixed node-id), and a relay actuator (also fixed node-id). Both sensors are a simple copy of the examples on this site. As a radio I use nrf24.After installing mqtt.fx everything looks promising: the broker gets information from the gateway, and even the both sensors are creating topics when entering. The door sensor seems to work since a button press leads to 2 messages.
But, how can I turn on/off the relay sensor? for the sake of the simplicity the relay has been exchanged with a led/resistor. After reading several hours, digging into forums, using google & youtube, I have still no luck to be able to switch the led on/off.
I thought that I needed to follow the information listed in the serial API. More concrete:
my- node id = 250
- child-sensor-id = 1
- command ( i want to set,so 1)
- ack ( don't care for now, so 0)
- type V_status because the sensor is S_BINARY, so value=2
And in the mqtt sketch that is in the gateway:
#define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"
#define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mygateway1-in"When I publish in mqtt.fx the topic:
mygateway1-in/250/1/1/0/2. I see in the debug log of the relay-node:
3682377 TSF:MSG:READ,0-0-250,s=1,c=1,t=2,pt=0,l=0,sg=0:
Incoming change for sensor:1, New status: 0to add another / to the topic followed by 1 or 0 does not see any information in the debug log of the relay-sensor.
What part am I missing to set/unset the payload in an MQTT message?
But how can I add the payload to on/off the relay ?
I tried in mqtt.fx