@sundberg84 Nice, I had hanging issues with Domoticz in the past, until I decided to switch to Home Assistant. Best decision ever.
iancu
@iancu
Best posts made by iancu
-
RE: What did you build today (Pictures) ?
-
RE: NodeManager Relay in Homeassistant
@Michał-Szura I had problems with relay and HA too. The best solution was to save the state of the relay in the EEPROM and to recall the value after a defined amount of time and send it to HA in loop(). This way you do not have to restart the relay node everytime you restart HA.
-
RE: hi guys can anyone suggest any working controller this present days for this project thank you in advance
I have tried Domoticz, Mozilla WebThings and Home Assistant. So far the best is Home Assistant, it has many integrations and a nice UI. If you want to be able to access it outsite your network I recommend ZeroTier (had many issues trying thru the router).
Latest posts made by iancu
-
RE: Raspberry PI killing memory cards
Thank you all for the advice! I will try first with log2ram, but for long term I want to install an SSD.
A nice week to all!
-
RE: Raspberry PI killing memory cards
@skywatch i have the original charger. Does it matter if the SSD is external type?
-
RE: Raspberry PI killing memory cards
@Yveaux for how long do you use it?
-
Raspberry PI killing memory cards
Hi,
Yesterday my controller (HA) went down, after some debugging it seems that there is a problem with the memory card. Then I remembered a colleague which had similar issues but with Domoticz. My Raspberry worked for about 1 year without issues. Do you guys have the same problem? I am thinking to switch to a device (for HA) that supports different types of memory (like this or this).
Cheers!
-
RE: (Solved) S_Multimeter in HomeAssistant
Here is some code I use with NRF24 for a temperature sensor . So far works great with lastest HA version.
// Enable debug prints to serial monitor //#define MY_DEBUG #define MY_RADIO_NRF24 #define MY_NODE_ID 10 #define DEBUG 0 #define BATTERY_SENSOR 1 #include <MySensors.h> #define TH1_CHILD_ID 11 #define VOLTAGE_CHILD_ID 12 #define TH_PIN 3 int _nominal_resistor = 4700; int _nominal_temperature = 25; int _b_coefficient = 3950; int _series_resistor = 4877; int _pin = 0; float BatteryMin = 2.4; float BatteryMax = 3.0; MyMessage msgTemp(TH1_CHILD_ID, V_TEMP); MyMessage msgVoltage(VOLTAGE_CHILD_ID, V_VOLTAGE); void setup() { //Serial.begin(115200); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Temp battery", "1.0"); present(TH1_CHILD_ID, S_TEMP, "Temp"); present(VOLTAGE_CHILD_ID, S_MULTIMETER, "Batt"); } void loop() { tempReport(); batteryReport(); sleep(180000); } // Measure VCC float getVcc() { #ifndef MY_GATEWAY_ESP8266 // Measure Vcc against 1.1V Vref #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) ADMUX = (_BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1)); #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) ADMUX = (_BV(MUX5) | _BV(MUX0)); #elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) ADMUX = (_BV(MUX3) | _BV(MUX2)); #else ADMUX = (_BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1)); #endif // Vref settle wait(70); // Do conversion ADCSRA |= _BV(ADSC); while (bit_is_set(ADCSRA, ADSC)) {}; // return Vcc in mV return (float)((1125300UL) / ADC) / 1000; #else return (float)0; #endif } // Send a battery level report to the controller void batteryReport() { // measure the board vcc float volt = getVcc(); // calculate the percentage int percentage = ((volt - BatteryMin) / (BatteryMax - BatteryMin)) * 100; if (percentage > 100) percentage = 100; if (percentage < 0) percentage = 0; #if DEBUG == 1 Serial.print(F("BATT V=")); Serial.print(volt); Serial.print(F(" P=")); Serial.println(percentage); #endif #if BATTERY_SENSOR == 1 // report battery voltage send(msgVoltage.set(volt, 3)); #endif // report battery level percentage sendBatteryLevel(percentage); } void tempReport() { // set TH pin in output mode pinMode(TH_PIN, OUTPUT); // set TH_PIN HIGH digitalWrite(TH_PIN, HIGH); wait(1); // read the voltage across the thermistor float adc = analogRead(_pin); // set TH_PIN LOW digitalWrite(TH_PIN, LOW); // calculate the temperature float reading = (1023 / adc) - 1; reading = _series_resistor / reading; float temperature; temperature = reading / _nominal_resistor; // (R/Ro) temperature = log(temperature); // ln(R/Ro) temperature /= _b_coefficient; // 1/B * ln(R/Ro) temperature += 1.0 / (_nominal_temperature + 273.15); // + (1/To) temperature = 1.0 / temperature; // Invert temperature -= 273.15; // convert to C #if DEBUG == 1 Serial.print(F("THER I=")); Serial.print(TH1_CHILD_ID); Serial.print(F(" V=")); Serial.print(adc); Serial.print(F(" T=")); Serial.println(temperature); #endif send(msgTemp.set(temperature, 1)); }
-
RE: Battery powered latching relay node
@mtiutiu Thank you for the information! I will give it a try with the bluetooth module.
I use Home Assistant as the controller and store the relay state in the EEPROM (according to the relay example) and on top of that I have configured the node to send updates of the state (taken form EEPROM) to home assistant periodically.
-
RE: NodeManager Relay in Homeassistant
@Michał-Szura I had problems with relay and HA too. The best solution was to save the state of the relay in the EEPROM and to recall the value after a defined amount of time and send it to HA in loop(). This way you do not have to restart the relay node everytime you restart HA.
-
RE: Battery powered latching relay node
@mfalkvidd Thanks for the info! Then my idea is not worth the trouble (would have to change the batteries too often).
A good day to everyone! -
RE: Battery powered latching relay node
@Grubstake that sleep time is too much, even 2 seconds delay is not good for me. But, last night I got an idea, so I will supply the whole node with 3V. I was thinking to supply the NRF24 directly from the battery and use it as an interrupt when the gateway will transmit. According to some google-ing the stand-by current of the NRF24 is pretty low. Could this work? Do you know if the IRQ pin is used for something in mysensors?
PS: @Yveaux while loop ideea did not work as expected
-
RE: Battery powered latching relay node
@Yveaux thank you for the help! I managed to make it work. Now need to see how to optimize it to be able to run as long as possible from the batteries. I was thinking to use a while loop to check V_STATUS, send command to relay and then go to sleep.