Skip to content

Home Assistant

246 Topics 1.8k Posts
  • Events instead of states

    event button
    2
    0 Votes
    2 Posts
    44 Views
    alexeliteA
    @toddles I don't think you can trigger an event directly. HA mysensors integration changes the state of entities only. Your node sends button state on one single sensor id, value dependent on key pressed? And you only send on depressed event not on release? If so, why not send also a release event, or count the times one button is pressed before sending?
  • 3 Votes
    1 Posts
    34 Views
    No one has replied
  • Home Assistant and smartSleep

    home assistant smartsleep battery powered
    1
    0 Votes
    1 Posts
    39 Views
    No one has replied
  • Migrate from Domoticz

    1
    0 Votes
    1 Posts
    46 Views
    No one has replied
  • Motion Sensor not presenting to RS485 Gateway / TSM:FPAR:NO REPLY

    12
    0 Votes
    12 Posts
    89 Views
    M
    @electrik Yes... that worked!!! Moved node and child id above mysensors.h Thank you!!!!
  • Can a gateway talk to itself?

    6
    0 Votes
    6 Posts
    66 Views
    YveauxY
    @Danielo-Rodríguez yes, that is correct
  • Mysensors Node not being recognized (added)

    3
    0 Votes
    3 Posts
    59 Views
    monteM
    Please read carefully the HA documentation: https://www.home-assistant.io/integrations/mysensors/ There it says that you need to present your node to HA by sending initial value of the node. Then HA adds it to its device list. if (!initialValueSent) { Serial.println("Sending initial value"); send(msg.set(state?RELAY_ON:RELAY_OFF)); Serial.println("Requesting initial value from controller"); request(CHILD_ID, V_STATUS); wait(2000, C_SET, V_STATUS); }
  • API questions regarding Home Assistant Core.

    3
    0 Votes
    3 Posts
    42 Views
    MatiasVM
    @pw44 The HA integrations page has useful information of how it al works together, check the presentation paragraph as it is important in HA. The node sketch shall make use of these defs for HA. Is it right? So, on a node sensor, i can have from 0 to 255 child_id's, each with it's name. But how to give a name for each child, if more than one sensor is connected to the node? The name can me customized in the presentation function in the description field: https://www.mysensors.org/apidocs/group__MySensorsCoregrp.html#gaef20c35998db495bd4c85bac42a7ad49 bool present ( const uint8_t sensorId, const mysensors_sensor_t sensorType, const char * description = "", const bool requestEcho = false ) Is this all right? if not, please educate me in the right way. And i'm also getting the following: This entity does not have a unique ID, therefore its settings cannot be managed from the UI. Any hint? This is a normal error in current versions of HA, the mysensors integration is still manual via YAML and cannot be managed from the HA FrontEnd.
  • serial gateway

    4
    0 Votes
    4 Posts
    85 Views
    electrikE
    You don't have to configure the gateway, just tell Home assistant the gateway is there. Did you follow the instructions in the link @BearWithBeard mentioned? Please note the nodes you use have to follow the presentation guide lines, else HA won't detect them automatically. https://www.home-assistant.io/integrations/mysensors/#presentation
  • Two MySensor gateways to the same Home Assistant

    2
    0 Votes
    2 Posts
    59 Views
    Boots33B
    @jocke4u yes that is correct, both gateways will also need to be using different channels as well.
  • Migrating from openHAB to Home Assistant

    6
    0 Votes
    6 Posts
    78 Views
    jocke4uJ
    Thanks @electrik for the update :) I got it running. However I think I should make some work on the sensors. As it seems the Ethernet GW are running 2.1.1 but I think the sensors are running 1.5.x (seen in MysController) But I get plenty of : 2020-05-28 19:29:47 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:30:22 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:30:57 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:31:32 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:32:07 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:33:17 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:33:51 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:34:26 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:35:01 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:35:36 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:36:11 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:36:46 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:37:21 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:38:31 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:39:06 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:39:41 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] 2020-05-28 19:40:50 WARNING (MainThread) [mysensors] Not a valid message: value must be float between 0.0 and 100.0 for dictionary value @ data['payload'] Trying to get my dev environment correct to be able to recompile. EDIT: Since it have been so stable for a long time I am not up to date with the Arduino environment. My experience from the past is not without issues
  • home Assistant and OTA support and node to node

    5
    1 Votes
    5 Posts
    114 Views
    MatiasVM
    @Joerideman said in home Assistant and OTA support and node to node: @MatiasV BTW why did you switch to mqtt? The wifi GW accepts multiple connections. I was experiencing problems when starting the HA "server" (AKA Old laptop) and GW, or while the WIFI was temporary off for any cause. We had some rough weeks with our electricity company. The GW would disconnect from HA and I had to restart the GW or sometimes even HA to get it working again. It was a mayor headache while I was out of the house, the MQTT GW is way more reliable for me.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • mysensors integration freezes when it triggers switch.toggle

    8
    0 Votes
    8 Posts
    69 Views
    monteM
    @kiesel interesting! But weird :) But why the power issue with one of the devices connected to HA breaks integration with Mysensors particularly?
  • Home Assistant errors with serial gateway

    gateway
    5
    0 Votes
    5 Posts
    70 Views
    K
    Hi electrik, Yes, my nodes send the sketch name within the presentation function. As for the gateway, I have not set up a sketch name, the example I found did not implement this, so I didn't think it was necessary? I manually named the gateway node in the configuration.yaml file, and the "missing sketch name" message no longer appears in the log. I guess, I'll add an entry for node 0 (controller) as well . I'm still getting the "USB0 not ready after 15.0 secs" at startup, but all seems to work regardless. I connected the gateway to my pc using mycontroller, it all works fine. Logs look normal. Here is the code for one of my nodes, a temperature node with Arduino mini & RFM69 radio, running on battery. // Enable debug prints to serial monitor #define MY_DEBUG #define MY_BAUD_RATE 38400 // Enable and select radio type attached //#define MY_RADIO_RF24 #define MY_RADIO_RFM69 #define MY_IS_RFM69HW #define MY_RFM69_FREQUENCY RFM69_915MHZ #include <MySensors.h> #include <DallasTemperature.h> #include <OneWire.h> #define COMPARE_TEMP 0 // Send temperature only if changed? 1 = Yes 0 = No #define ONE_WIRE_BUS 8 // Pin where dallas sensor is connected #define CHILD_ID_TEMP 0 #define CHILD_ID_BATT 1 // function protos void ReadBat(double& b, uint8_t& bPct); unsigned long SLEEP_TIME = 300000; // Sleep time between reads (5min) (in milliseconds) const int BAT_V = A0; // battery voltage, AnaIn 0 OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs) DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. float lastTemperature; double bat, lastBat=0.0; uint8_t batPct; int numSensors=0; bool receivedConfig = false; bool metric = true; bool initialValuesSent = false; bool initialValTempSent = false; bool initialValBatSent = false; // Initialize message objects MyMessage msg(CHILD_ID_TEMP, V_TEMP); MyMessage msgBatt(CHILD_ID_BATT, V_VOLTAGE); void before() { // Startup up the OneWire library sensors.begin(); } void setup() { sensors.setWaitForConversion(false); // requestTemperatures() will not block current thread Serial.print("Found "); Serial.print(sensors.getDeviceCount(), DEC); Serial.println(" temperature devices."); sensors.requestTemperatures(); } void presentation() { Serial.println("Sending presentation"); // Send the sketch version information to the gateway and Controller sendSketchInfo("Temperature Sensor", "1.2"); // Present all sensors to controller present(CHILD_ID_TEMP, S_TEMP, "Bed room Temperature"); present(CHILD_ID_BATT, S_MULTIMETER, "Bed room node Voltage"); } void loop() { int16_t conversionTime = 0; float temperature = 0; if (!initialValuesSent) { Serial.println("Sending initial value"); // Read in the battery voltage ReadBat(bat, batPct); // get temperature conversion time conversionTime = sensors.millisToWaitForConversion(sensors.getResolution()); wait(conversionTime); // Fetch temperature temperature = sensors.getTempCByIndex(0); // send the temperature reading // set(float value, uint8_t decimals) send(msg.set(temperature, 2)); Serial.println("Requesting initial Temp value from controller"); request(CHILD_ID_TEMP, V_TEMP); wait(2000, C_SET, V_TEMP); // send bat voltage send(msgBatt.set(bat, 2)); Serial.println("Requesting initial Batt value from controller"); request(CHILD_ID_BATT, V_VOLTAGE); wait(2000, C_SET, V_VOLTAGE); } // { else { // Fetch temperatures from Dallas sensors (non-blocking) sensors.requestTemperatures(); // Read in the battery voltage ReadBat(bat, batPct); // query conversion time and sleep until conversion completed conversionTime = sensors.millisToWaitForConversion(sensors.getResolution()); // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater) sleep(conversionTime); // Read temperature and send to controller // Fetch temperature temperature = sensors.getTempCByIndex(0); Serial.println("temperature: "); Serial.println(temperature); // Only send data if temperature has changed and no error #if COMPARE_TEMP == 1 if (lastTemperature != temperature && temperature != -127.00 && temperature != 85.00) { #else if (temperature != -127.00 && temperature != 85.00) { #endif // Send in the new temperature // set(float value, uint8_t decimals) send(msg.set(temperature, 2)); // Save new temperatures for next compare lastTemperature=temperature; } // Send in the new battery level sendBatteryLevel(batPct); send(msgBatt.set(bat, 2)); // Save the battery level for next compare lastBat = bat; Serial.println("Sleep..."); sleep(SLEEP_TIME); } } void receive(const MyMessage &message) { if (message.isAck()) { Serial.println("This is an ack from gateway"); } if (message.type == V_TEMP) { if (!initialValTempSent) { Serial.println("Received initial temp value from controller"); initialValTempSent = true; } } else if (message.type == V_VOLTAGE) { if (!initialValBatSent) { Serial.println("Received initial bat value from controller"); initialValBatSent = true; } } if (initialValTempSent && initialValBatSent) initialValuesSent = true; } // b - battery voltage // bPct - battery percent void ReadBat(double& b, uint8_t& bPct) { long sumBat=0; int i; // take average over 64 readings for (i = 0; i < 64; ++i) { // read & sum battery voltage sumBat += analogRead(BAT_V); } sumBat = sumBat >> 6; // shift 6 -> divide by 64 b = sumBat*3.3/1023.0; bPct = (uint8_t)(sumBat*100.0/1023.0); } Here is the serial gateway sketch: #include <SoftwareSerial.h> SoftwareSerial softSerial(8, 9); // RX, TX // Enable debug prints to serial monitor #define MY_DEBUG #define MY_DEBUGDEVICE softSerial // You also need to create softSerial in setup() // Enable and select radio type attached //#define MY_RADIO_RF24 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM95 #define MY_RADIO_RFM69 #define MY_IS_RFM69HW #define MY_RFM69_FREQUENCY RFM69_915MHZ // Set LOW transmit power level as default, if you have an amplified NRF-module and // power your radio separately with a good regulator you can turn up PA level. //#define MY_RF24_PA_LEVEL RF24_PA_LOW // Enable serial gateway #define MY_GATEWAY_SERIAL // Define a lower baud rate for Arduinos running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender) #if F_CPU == 8000000L #define MY_BAUD_RATE 38400 #endif // Enable inclusion mode #define MY_INCLUSION_MODE_FEATURE // Enable Inclusion mode button on gateway //#define MY_INCLUSION_BUTTON_FEATURE // Inverses behavior of inclusion button (if using external pullup) //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP // Set inclusion mode duration (in seconds) #define MY_INCLUSION_MODE_DURATION 60 // Digital pin used for inclusion mode button //#define MY_INCLUSION_MODE_BUTTON_PIN 3 // Set blinking period #define MY_DEFAULT_LED_BLINK_PERIOD 300 // Inverses the behavior of leds //#define MY_WITH_LEDS_BLINKING_INVERSE // Flash leds on rx/tx/err // Uncomment to override default HW configurations //#define MY_DEFAULT_ERR_LED_PIN 4 // Error led pin //#define MY_DEFAULT_RX_LED_PIN 6 // Receive led pin //#define MY_DEFAULT_TX_LED_PIN 5 // the PCB, on board LED #include <MySensors.h> void setup() { softSerial.begin(38400); } void presentation() { // Present locally attached sensors } void loop() { // Send locally attached sensor data here }
  • IR Node resending last signal ca every 15 minutes

    Moved
    18
    1
    0 Votes
    18 Posts
    171 Views
    K
    @electrik Thanks, I'll have a look at those updates. Do you mean the code I am using for my appdaemon app? I got everything I use from here: https://github.com/eifinger/appdaemon-scripts This is much cleaner and easier to understand than my code, but let me know if you want it anyway :)
  • Send a text to node

    12
    0 Votes
    12 Posts
    177 Views
    P
    And after a node reboot, the notify.mysensors service appears too : TSF:MSG:SEND,232-232-0-0,s=1,c=1,t=47,pt=0,l=12,sg=0,ft=0,st=OK:It works !!!
  • MY_NODE_ID AUTO support with serial gateway

    3
    0 Votes
    3 Posts
    40 Views
    cozaC
    I understand that I am just trying to find out why my new sensors are not getting an auto assigned node id when all I have done is move from a ethernet gateway to a serial gateway. We have had a few version updates in HA and I am not sure what is the cause.
  • Local sensor warning messages

    3
    1 Votes
    3 Posts
    42 Views
    N
    Haha.. Works perfect! Thank you.
  • 1 Votes
    3 Posts
    33 Views
    I
    Oh, it's good idea. Whenever I restarted Raspberry Pi, Arduino (connected by USB) is also restarted. Could you help me write correct code for Arduino, where I can readout data from DHT/ RFID/ limit switch and to control Stepper Motor?

14

Online

11.7k

Users

11.2k

Topics

113.0k

Posts