Local sensor (no radio)
-
I have a RPi 2 controller connected to a uno that has the radio (serial GW). I also have a arduino mega that controls all my heating zones in the house (11). Right now the mega is just spewing out debug on the serial port but I would love to connect it to the RPi and integrate it into my mysensors network. Is there any libraries for doing this or has anyone done similar? I don't want to add a radio to the mega as it is sitting right beside the controller.
Thanks!
-
Depending on how curious you are, and how advanced a setup you want, You could make a mockup that emulates the serialport protocol, it should be pretty easy to do. Or you could make a nodered flow, that picks up data from your mega, and remaps it to mysensor protocol, and then inject that into the data stream in to you controller of choice.
-
Yeah - I guess I was hoping someone else had pioneered it
It is interesting though. I'll try and send the wife and kids away for a week!
-
You should have a look at the "gateway-refactoring" branch. Over there it is possible to create a node without radio.
A serially attached gateway motion sensor would look like this:
// Enable debug prints to serial monitor #define MY_DEBUG // Enable serial gateway #define MY_GATEWAY_SERIAL #include <MySensor.h> #define CHILD_ID 1 MyMessage msg(CHILD_ID, V_TRIPPED); void setup() { sendSketchInfo("Motion Sensor", "1.0"); pinMode(DIGITAL_INPUT_SENSOR, INPUT); present(CHILD_ID, S_MOTION); } void loop() { boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; send(msg.set(tripped?"1":"0")); // Send tripped value to gw sleep(INTERRUPT,CHANGE, SLEEP_TIME); }
-
@hek
And what or how do you register this sensor in domoticz?
-
Sorry, haven't used Domoticz myself.
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Saving last known good state, but not in EEPROM
Development • 30 Jan 2024, 18:46 • OldSurferDude 15 Jan 2025, 08:51 -
MQTT-Help me understand about the MQTT Gateway.
Development • 2 Mar 2025, 01:44 • dpcons 20 days ago -
PJON and Minicore not working
Development • 11 days ago • Trand 11 days ago -
LAN8720A - will mysensors work with this module
Development • 13 Nov 2024, 17:06 • Marcin 15 Nov 2024, 10:59 -
Counting Incoming and Outgoing Messages from a Gateway
Development • 10 Dec 2024, 21:57 • Trand 14 Dec 2024, 20:23