@gohan Not at all. It's just that the pairing process has a manual element (as opposed to being capable of being auto discovered) to it as it's not officially supported by ST. Community members have developed device drivers for the window, temp, PIR and pushbutton switches. Although I had a few issues trying to settle on the right zigbee frequency (2.4Ghz so susceptible to interference from wifi sources), once that was sorted everything is working great.
Posts made by gadgetman
-
RE: Fewer home automation postings? What's behind it?
-
RE: Fewer home automation postings? What's behind it?
@NeverDie Just do a search on sites like gearbest.com or Banggood.com for Xiaomi smart home. The common sensors go on sale fairly often but they're usually less than $10 a pop.
-
RE: Fewer home automation postings? What's behind it?
@gohan I don't use their gateway as it's a bit clunky although it does have local control. Like many I use a Samsung smartthings hub which doesn't cost much more as it's often heavily discounted - pairing with the ST hub can be hit or miss though.
-
RE: Fewer home automation postings? What's behind it?
Rise of cheap zigbee sensors from China is my take. I have a bunch of highly reliable magnetic reed sensors, push buttons, PIR, temp sensors that are smaller and better looking than anything I could make with mysensors. I'm using ms for the more complex and custom applications I have in mind.
-
RE: Can I have multiple sleep/interrupt events in the one sketch?
@gohan Lol you're absolutely right! I should have thought of that earlier - thanks!
-
Can I have multiple sleep/interrupt events in the one sketch?
I have a prototype battery relay node working, where using smart sleep I am able to turn on a relay (currently just a connected LED) and off from the controller, with a lag in actuation equal to the smart sleep duration.
What I would now like to do is to introduce a secondary function where the node is able to turn the relay off after a preset period if no off command is received from the controller. Is this possible by introducing another sleep timer? If so how could I do this (as opposed to having a controller rule send the off command).
Here's my quick and dirty test sketch - hacked from the relay node example.
// Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #define MY_RF24_PA_LEVEL RF24_PA_LOW // Enable repeater functionality for this node // #define MY_REPEATER_FEATURE #include <MySensors.h> #define MY_SMART_SLEEP_WAIT_DURATION_MS 1000 //#define RELAY_1 3 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #define LEDpin 5 //#define NUMBER_OF_RELAYS 1 // Total number of attached relays //#define RELAY_ON 1 // GPIO value to write to turn on attached relay #define LED_ON 1 //#define RELAY_OFF 0 // GPIO value to write to turn off attached relay #define LED_OFF 0 #define VMIN 1.9 // Battery monitor lower level. Vmin_radio=1.9V #define VMAX 3.0 // " " " high level. Vmin<Vmax<=3.44 int BATTERY_SENSE_PIN = A1; // select the input pin for the battery sense point int oldBatteryPcnt = 0; // Sleep time between sensor updates (in milliseconds) static const uint64_t UPDATE_INTERVAL = 60000; #define child 1 void before() { //for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) { // Then set relay pins in output mode pinMode(LEDpin, OUTPUT); // Set relay to last known state (using eeprom storage) digitalWrite(LEDpin, loadState(LEDpin)?LED_ON:LED_OFF); } //} void setup() { analogReference(INTERNAL); // use the 1.1 V internal reference for battery level measuring } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Relay", "1.0"); // for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) { // Register all sensors to gw (they will be created as child devices) present(child, S_BINARY); } //} void loop() { // get the battery Voltage int sensorValue = analogRead(BATTERY_SENSE_PIN); #ifdef MY_DEBUG Serial.println(sensorValue); #endif // 1M, 470K divider across battery and using internal ADC ref of 1.1V // Sense point is bypassed with 0.1 uF cap to reduce noise at that point // ((1e6+470e3)/470e3)*1.1 = Vmax = 3.44 Volts // 3.44/1023 = Volts per bit = 0.003363075 float batteryV = sensorValue * 0.003347095; int batteryPcnt = static_cast<int>(((batteryV-VMIN)/(VMAX-VMIN))*100); #ifdef MY_DEBUG Serial.print("Battery Voltage: "); Serial.print(batteryV); Serial.println(" V"); Serial.print("Battery percent: "); Serial.print(batteryPcnt); Serial.println(" %"); #endif if (oldBatteryPcnt != batteryPcnt) { // Power up radio after sleep sendBatteryLevel(batteryPcnt); oldBatteryPcnt = batteryPcnt; } // Sleep for a while to save energy (using martsleep) smartSleep(UPDATE_INTERVAL); } 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(LEDpin, message.getBool()?LED_ON:LED_OFF); // Store state in eeprom saveState(LEDpin, message.getBool()); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } }
-
RE: Help with Thing/sketch syntax for transmitted variables
Happy to look at them - could you tell me where they're located?
-
RE: Help with Thing/sketch syntax for transmitted variables
I'll do that - it doesn't happen with other bindings though. So maybe one for Timo?
-
RE: Help with Thing/sketch syntax for transmitted variables
Thanks for that - will play with the different sensor types - I've got humidity/temp/battery worked out from the github wiki.
However I have a different question now (background - I installed the binding via the eclipse marketplace although I assume that has no bearing on the issue). The humidity/temperature sensors (which are what I've built so far) are discovered automatically in paperui (which is good) and I have them populating paperui control (using simple mode). I've noticed that the thing channel names in paperui control don't survive a reboot of my raspberry pi. While the sensor values eventually reappear, I need to unlink and relink the channels for each thing for the names to reappear. Is this normal? (as mentioned I'm running the mysensors ethernet gateway and openhab2 on the same pi)
-
RE: Help with Thing/sketch syntax for transmitted variables
Ah I see. Will search some more then! Thanks.
-
RE: Help with Thing/sketch syntax for transmitted variables
Thanks - I've been searching but still unclear. I've got battery status for the humidity sensor working as part of the humidity "thing" using the "sendBatteryLevel" function but if I wanted to simply define a custom thing for just battery level alone how do I define the variable in the thing?
-
Help with Thing/sketch syntax for transmitted variables
My mysensors OH2/ethernet gateway is all set up and operational using the predefined paperui things (DHT11 sensors for the moment). All works great so far.
My next step (and what I'm a bit unclear about) is to manually set up my own things using the various mysensors presentation types/variables. Would appreciate it if someone could point me to some examples to help me work this out. For example if I simply wanted to report the battery level of a node what do I send as the payload from the sensor and how do I define the corresponding thing?
-
Raspberry Pi gateway - how to reset node id allocations?
I've just managed to get my all in one pi 3 based HA (Openhab + mysensors ethernet gateway) running. However during the testing phase I ended up allocating node ids left right and centre due to resetting the eeprom on my test sensor board. So now I'm up to device 17. I'd like to reset the allocation to zero to start over (effectively clearing the mesh) but can't find any references as to whether this is possible. Help!