Skip to content

Home Assistant

246 Topics 1.8k Posts
  • Problem with IP camera Foscam FI8910W - IP Camera(Error loading image)

    3
    0 Votes
    3 Posts
    2k Views
    Maurizio ColluM
    @Maurizio-Collu said: Dear all, I bought a Foscam FI8910W IP camera, and I followed the instruction provided here to add it to my Home Assistant system: https://home-assistant.io/components/camera.foscam/ I can see the "camera.ip_camera" entity now among currrent entities, and I added it to the home Screen. Anyway, I cannot see anything and instead I only have a window saying: "IP Camera(Error loading image)" I must specify that if with my browser I go to the same ip, I can see the camera OK, no problem, as I already set it up with the FOSCAM software. Does anyone else had the same problem / solved it? Thanks, I'll try. Maurizio
  • Call/Trigger custom functions/effects from Home Assistant

    3
    0 Votes
    3 Posts
    2k Views
    eBesE
    That makes sense! Awesome! Thanks for the quick reply! :)
  • Can't see my nodes on HA web interface

    20
    0 Votes
    20 Posts
    6k Views
    martinhjelmareM
    @adrian I would try something like this: /* * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * http://www.mysensors.org/build/relay */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 // Enabled repeater feature for this node #define MY_REPEATER_FEATURE #define MY_NODE_ID 1 #include <SPI.h> #include <MySensors.h> #include <Bounce2.h> #define RELAY_PIN 5 // Arduino Digital I/O pin number for relay #define BUTTON_PIN 3 // Arduino Digital I/O pin number for button #define CHILD_ID 1 #define RELAY_ON 1 #define RELAY_OFF 0 Bounce debouncer = Bounce(); bool state = false; bool initialValueSent = false; MyMessage msg(CHILD_ID, V_STATUS); void setup() { // Setup the button pinMode(BUTTON_PIN, INPUT_PULLUP); // After setting up the button, setup debouncer debouncer.attach(BUTTON_PIN); debouncer.interval(10); // Make sure relays are off when starting up digitalWrite(RELAY_PIN, RELAY_OFF); // Then set relay pins in output mode pinMode(RELAY_PIN, OUTPUT); // Set relay to last known state (using eeprom storage) state = loadState(CHILD_ID); digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF); } void presentation() { sendSketchInfo("Lamp", "1.0"); present(CHILD_ID, S_BINARY); } void loop() { 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); } if (debouncer.update()) { if (debouncer.read()==LOW) { state = !state; send(msg.set(state?RELAY_ON:RELAY_OFF), true); // Send new state and request ack back } } } void receive(const MyMessage &message) { if (message.isAck()) { Serial.println("This is an ack from gateway"); } if (message.type == V_STATUS) { if (!initialValueSent) { Serial.println("Receiving initial value from controller"); initialValueSent = true; } // Change relay state state = (bool)message.getInt(); digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF); send(msg.set(state?RELAY_ON:RELAY_OFF)); // Store state in eeprom saveState(CHILD_ID, state); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getInt()); } } Node serial log: Starting repeater (RNNRA-, 2.0.0) TSM:INIT TSM:RADIO:OK TSP:ASSIGNID:OK (ID=1) TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSP:MSG:READ 0-0-1 s=255,c=3,t=8,pt=1,l=1,sg=0:0 TSP:MSG:FPAR RES (ID=0, dist=0) TSP:MSG:PAR OK (ID=0, dist=1) TSM:FPAR:OK TSM:ID TSM:CHKID:OK (ID=1) TSM:UPL TSP:PING:SEND (dest=0) TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1 TSP:MSG:READ 0-0-1 s=255,c=3,t=25,pt=1,l=1,sg=0:1 TSP:MSG:PONG RECV (hops=1) TSP:CHKUPL:OK TSM:UPL:OK TSM:READY TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100 TSP:MSG:SEND 1-1-0-0 s=255,c=0,t=18,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0 TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=ok:0 TSP:MSG:READ 0-0-1 s=255,c=3,t=6,pt=0,l=1,sg=0:M TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=11,pt=0,l=4,sg=0,ft=0,st=ok:Lamp TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=ok:1.0 TSP:MSG:SEND 1-1-0-0 s=1,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=ok: Request registration... TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2 TSP:MSG:READ 0-0-1 s=255,c=3,t=27,pt=1,l=1,sg=0:1 Node registration=1 Init complete, id=1, parent=0, distance=1, registration=1 Sending initial value TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:0 Requesting initial value from controller TSP:MSG:SEND 1-1-0-0 s=1,c=2,t=2,pt=0,l=0,sg=0,ft=0,st=ok: TSP:MSG:READ 0-0-1 s=1,c=1,t=2,pt=0,l=1,sg=0:0 Receiving initial value from controller TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:0 Incoming change for sensor:1, New status: 0 TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:1 TSP:MSG:READ 0-0-1 s=1,c=1,t=2,pt=2,l=2,sg=0:1 This is an ack from gateway TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:1 Incoming change for sensor:1, New status: 1 TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:0 TSP:MSG:READ 0-0-1 s=1,c=1,t=2,pt=2,l=2,sg=0:0 This is an ack from gateway TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:0 Incoming change for sensor:1, New status: 0 Btw, message.getBool() always returns 0 in my tests, so I switched to message.getInt() in the sketch above. Can anyone confirm that message.getBool is working in 2.0.0?
  • Windows and configuration.yaml

    11
    0 Votes
    11 Posts
    5k Views
    G
    @martinhjelmare Hi, with python 32bit, it's perfect. Thank you.
  • Remove duplicated mysensors in homeassistant front-end

    7
    0 Votes
    7 Posts
    5k Views
    John NguyenJ
    sweet, i got it. Thanks! spacing in my config. yaml file. used tab instead of space which is why notepad++ had that line in red. also had to move a few lines back under gateways: line. [image: 1468903333436-upload-532b435d-f7d7-4df1-8159-7a0e2c7d2b68]
  • unable to open USB port

    23
    0 Votes
    23 Posts
    6k Views
    D
    @chilliman No problem; just glad to hear you got it working. Everyone is new sometime. FYI I made quite a few mistakes in the configuration.yaml file - took me a while to realize spaces were important ;) Let us know if you have any other problems.
  • Basic question: Light sensors

    3
    0 Votes
    3 Posts
    2k Views
    D
    @martinhjelmare Thanks martin. I think I got the code handled properly, but i'm getting a compile error. /** * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * REVISION HISTORY * Version 1.0 - Derrick Rockwell (@Drock1985) * * DESCRIPTION * * */ // Enable debug prints #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #define MY_NODE_ID 21 #define MY_REPEATER_FEATURE //Enables Repeater feature for non-battery powered nodes. #include <SPI.h> #include <MySensors.h> #include <DallasTemperature.h> #include <OneWire.h> #include <BH1750.h> #include <Wire.h> unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds) #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!) #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No #define ONE_WIRE_BUS 4 // Pin where dallase sensor is connected 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. int lastTemperature = 0; boolean receivedConfig = false; boolean metric = true; #define CHILD_ID_MOTION 1 // Id of the sensor child #define CHILD_ID_TEMP 2 // ID of Temperature Sensor #define CHILD_ID_LUX 3 // ID of Lux Sensor BH1750 lightSensor; // Initialize messages MyMessage msgMotion(CHILD_ID_MOTION, V_TRIPPED); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); MyMessage msgLux(CHILD_ID_LUX, V_LEVEL); //Sets up custom units (this case LUX for Light) MyMessage msgPrefix(CHILD_ID_LUX, V_UNIT_PREFIX); // Sends controller the LUX value instead of % uint16_t lastlux = 0; void setup() { pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input lightSensor.begin(); // Startup up the OneWire library sensors.begin(); // requestTemperatures() will not block current thread sensors.setWaitForConversion(false); send(msgPrefix.set("Lux")); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("LuxMotionTempSensor", "1.0"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID_MOTION, S_MOTION); present(CHILD_ID_TEMP, S_TEMP); present(CHILD_ID_LUX, S_LIGHT_LEVEL); } void loop() { { uint16_t lux = lightSensor.readLightLevel();// Get Lux value Serial.println(lux); if (lux != lastlux) { send(msgLux.set(lux)); send(msgPrefix.set("Lux")); lastlux = lux; }} // Fetch temperatures from Dallas sensors sensors.requestTemperatures(); // Fetch and round temperature to one decimal int temperature = (((sensors.getTempCByIndex(0)) * 10.)) / 10.; #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 send(msgTemp.set(temperature,1)); // Save new temperatures for next compare lastTemperature = temperature; }} // Read digital motion value boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; // Serial.println(tripped); send(msgMotion(tripped?"1":"0")); // Send tripped value to gw // Sleep until interrupt comes in on motion sensor. Send update every two minute. sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME); } I'll try it again tomorrow. Thank you again for pointing me in the right direction on custom units.
  • 0 Votes
    22 Posts
    6k Views
    X
    Let me complete the example given for the node when you use V_IR_SEND. In order to send IR codes you need to transform the code in an unsigned long: char ircode[11] = {0}; // in case your code takes the form of 0xE0E0FF0F ... if (message.type == V_IR_SEND) { String hexstring = message.getString(); hexstring.toCharArray(ircode, sizeof(ircode)); ... // get the code as an unsigned long unsigned long code = strtoul(ircode, NULL, 0); // with IRLib send the code to TV sendSAMSUNG(code); ... Very simple, ** but is hard to find an example**!
  • Is it possible to delete specific nodes?

    3
    1 Votes
    3 Posts
    2k Views
    D
    Thanks @danivalencia
  • Set Dimmer level in a Script

    4
    0 Votes
    4 Posts
    1k Views
    hekH
    Sorry, didn't read which category this was posted in.
  • Sending Battery level with sensor data.

    3
    0 Votes
    3 Posts
    3k Views
    Lee GroomL
    that i can do :) perfect,, thank you..
  • Notification platform

    9
    0 Votes
    9 Posts
    2k Views
    martinhjelmareM
    @kernald Hi! Home assistant uses pymysensors to interface with mysensors. S_INFO/V_TEXT should be added along side the other new types in a const_20 module. I have a branch for this already that I can push. We will need to bump version on pymysensors also and use this version in your branch for home assistant. Then you will be able to use those types to setup a mysensors notify platform. You can look at how the other mysensors platforms are setup.
  • fail presentation

    presentation humidity home-assistant
    7
    0 Votes
    7 Posts
    3k Views
    K
    @martinhjelmare Wow thank you so much. I've cleared the eeprom and now it gets node id 1. After removing the persistence file the sensor now shows on the web interface.
  • Any plan to implement Ethernet GW?

    69
    0 Votes
    69 Posts
    18k Views
    S
    @martinhjelmare As soon as i have the time (and clean up my code because it was a hack) i'll create a pull request. i've mine also at 0.02 and my (pi zero) CPU is now at around 8-10%.
  • Home Assistant v 0.13.1

    dimmer light switch switch serial gateway home assistant
    13
    1 Votes
    13 Posts
    6k Views
    martinhjelmareM
    I've updated the docs at home-assistant.io with sketch examples. Look at the light example. https://home-assistant.io/components/light.mysensors/#example-sketch It's what I used for testing during development. It adds an RGB sensor/actuator also besides a dimmer, but you can just remove any references to rgb in the sketch. The dimmer slider will only be visible after turning on the light and clicking the entity in the gui to bring up the more info card.
  • This topic is deleted!

    2
    0 Votes
    2 Posts
    80 Views
  • Handling ACK from MySensors

    19
    0 Votes
    19 Posts
    9k Views
    M
    In HomeAssistant, if you use MQTT switch for example, with state and command topic, the command is send to the gateway when requested from the interface, but the switch on the interface change itself when it receive back the status from the gateway. If the message doesn't reach the destination and comes back with the new status, the interface doesn't change the switch state. I encounter this situation a lot of times. After many tests, my findings show that the messages are lost between the nodes and the gateway, but I never miss a message between the gateway and the controller. So, while it will be nice and useful to have an end-to-end implementation with ACK and automatically retries, the real problem can be solved if such mechanism will be available between nodes and gateway.
  • 'Bad byte' error

    34
    0 Votes
    34 Posts
    8k Views
    martinhjelmareM
    Well pyserial should be installed automatically when you run hass the first time with mysensors activated in the config. There shouldn't be a need to do that on your own. Are you sure it wasn't installed for you?
  • Problem with S_RGB_LIGHT

    10
    0 Votes
    10 Posts
    4k Views
    martinhjelmareM
    @danivalencia :thumbsup:
  • Conditional group visibility

    2
    0 Votes
    2 Posts
    1k Views
    martinhjelmareM
    @Dave-Dan I'm not sure about the group. Have you tried asking on gitter or the home assistant forum? If you have mysensors related ideas for home assistant, post them in this category here. Other ideas regarding home assistant can be put forward as issues on github.

18

Online

11.7k

Users

11.2k

Topics

113.0k

Posts