Only recently I started to really actively looking into building my own home automation, so as you can guess I am pretty noob in it … at least for now ! With whatever difficulty I had, I finally managed to install the latest version of the home assistant on my computer and get it up and running ! However, after first modification of YAML file and restarting the whole homeassistant, I noticed that my configuration log keeps writing errors;
Traceback (most recent call last):
File “C:\Users\Mehrdad\AppData\Local\Programs\Python\Python35\lib\site-packages\homeassistant\bootstrap.py”, line 157, in setup_component
result = component.setup(hass, config)
File "C:\Users\Mehrdad\AppData\Local\Programs\Python\Python35\lib\site-packages\homeassistant\components\mqtt_init.py", line 238, in setup
client_cert, tls_insecure, protocol)
File “C:\Users\Mehrdad\AppData\Local\Programs\Python\Python35\lib\site-packages\homeassistant\components\mqtt_init_.py”, line 324, in init
self._mqttc.connect(broker, port, keepalive)
File “C:\Users\Mehrdad\AppData\Roaming.homeassistant\deps\paho\mqtt\client.py”, line 685, in connect
self.connect_async(host, port, keepalive, bind_address)
File “C:\Users\Mehrdad\AppData\Roaming.homeassistant\deps\paho\mqtt\client.py”, line 743, in connect_async
if keepalive < 0:
TypeError: unorderable types: NoneType() < int()
16-08-31 11:09:29 mysensors.mysensors: Unable to connect to /dev/ttyACM0
16-08-31 11:09:29 mysensors.mysensors: Unable to connect to /dev/ttyUSB0
16-08-31 11:09:29 homeassistant.components.recorder: Ended unfinished session (id=4 from 2016-08-31 09:56:10.638415)
16-08-31 11:09:29 homeassistant.components.recorder: Found unfinished sessions
16-08-31 11:09:30 mysensors.mysensors: Failed to connect to socket at (‘192.168.1.65’, 5003).
16-08-31 11:09:39 mysensors.mysensors: Unable to connect to /dev/ttyACM0
16-08-31 11:09:39 mysensors.mysensors: Unable to connect to /dev/ttyUSB0
16-08-31 11:09:41 mysensors.mysensors: Failed to connect to socket at (‘192.168.1.65’, 5003).
16-08-31 11:09:49 mysensors.mysensors: Unable to connect to /dev/ttyACM0
16-08-31 11:09:49 mysensors.mysensors: Unable to connect to /dev/ttyUSB0
16-08-31 11:09:50 netdisco.ssdp: Found malformed XML at http://192.168.1.86:2871/dms.xml: <?xml version="1.0" encoding="utf-8"?>
1
0
Can one of you guys please spare me some minutes to help me to pass this error ? Also, I I am little bit confused about the whole hierarchy of setting things up in my homeassistant. I would really appreciate if someone can tell me what are the steps to be able to read a data from a temp sensor that is connected to my arduino nano and its radio module.
Again apologies for possibly wasting your time by asking silly simple questions ! I promise, once I get into swing of things I will help another newbie like myself
I’m not sure if I can help because I don’t use mysensors sensors, but the first step would be to post your configuration.yaml file (after scrubbing it and replacing any personal data or passwords with the word REDACTED) here and that way we can all get a look at it. WHen you post it, make sure you use the preformatted text option so it will appear here just like you typed it.
A lot of the time - especially when you are new to this - it’s simple error in YAML formatting; a missing colon or the wrong indent. So another thing you can check on your own is to run it through an online syntax checker. Just google “Online YAML syntax checker”.
Thank you for your reply. I came across homeassistant from mysensors website, which I really hope I manage to learn how to use it. Below is the copy of my YAML. I was hoping that as an initial step, homeassistant can discover my chromecast which is on the same network.
Maybe a dumb question, but can homeassistant communicate with arduino boards through nRF24L01+ modules ? or putting simply, can I switch a light on/off which is connected to my arduino by using homeassistant (given that I already know how to do it by using relays and programming the arduino itself)?
Looking forward to hearing back from you,
`homeassistant:
# Name of the location where Home Assistant is running
name: REDACTED
# Location required to calculate the time the sun rises and sets
latitude: REDACTED
longitude: REDACTED
# Impacts weather/sunrise data
elevation: 0
# metric for Metric, imperial for Imperial
unit_system: metric
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: REDACTED
# Show links to resources in log and frontend
introduction:
# Enables the frontend
frontend:
http:
# Uncomment this to add a password (recommended!)
api_password:
# Checks for available updates
updater:
# Discover some devices automatically
discovery:
# Allows you to issue voice commands from the frontend in enabled browsers
conversation:
# Enables support for tracking state changes over time.
history:
# View all events in a logbook
logbook:
# Track the sun
sun:
# Weather Prediction
sensor:
platform: yr
# Example configuration.yaml entry
mysensors:
gateways:
- device: '/dev/ttyUSB0'
persistence_file: 'path/mysensors.json'
baud_rate: 38400
- device: '/dev/ttyACM0'
persistence_file: 'path/mysensors2.json'
baud_rate: 115200
- device: REDACTED
persistence_file: 'path/mysensors3.json'
tcp_port: 5003
- device: mqtt
persistence_file: 'path/mysensors4.json'
topic_in_prefix: 'mygateway1-out'
topic_out_prefix: 'mygateway1-in'
debug: true
optimistic: false
persistence: true
retain: true
version: 2.0`
I don’t know about the arduino boards, but I’d be surprised if this wasn’t support as I see mentions of it in the forums. To be honest, I’m not really a hardware hacker. I’ve considered it, but my electronics skills and understanding are sorely lacking.
I’m hoping somewhere down the line I’ll try something with this since a lot of HA users make their own sensors so there should be people here who can help.
Thank you so much for your help. I had a look on all the links, but sadly, I haven’t managed to pass my error … I wish there was one single simple tutorial (or even a flowchart or bullet points) from start to end showing how one can setup a sensor + arduino + homeassistane .
What I found a bit confusing is that, there are so many different releases and versions which may not work well with one another …
Short story … I am still struggling to setup my homeassistant !
based on the config above looks like you’re using 4 differenc gateways (USB, MQTT and others and also based on the error message you can’t connect to dev/ttyACM0, dev/ttyUSB0 and something is weird with the MQTT.
No need for apology, at the stage I am at, any question is a new lesson for me … So in fact thanks for taking time to help me !
Answering your questions;
Gateways: one … I think I only have one gateway (the reason I said one is that, there is only one arduino board and one nRF24L01+ module currently active)
Type : USB … the Arduino board is connected to my laptop with a USB cable.
Yes, exactly. But one thing to note is that, in that demonstration video, they use an older version of the serialgateway code … I used the updated version that is named " GatewaySerial" in mysensor V2 library.
Sorry for the delay in responding, had to answer a phone call.
I will hook up a simple temp sensor … now that I said it, how do I tell my arduino to pass on the readings from the sensor to the gateway ? should I add a specific code line?
That’s where the persistence of the mysensors sensors is stored. You need to create a file (the process much be able to read and write on it) and update the configuration with the correct path.
Check that and let’s take another look to the logs.
One step forward ! Yay ! now following your suggestion, HM finds the arduino, but it comes up with an error while tries to interpret the data from sensor … So I think, USB port is sorted, but “mysenosrs.json” is still a problem. How do you advise to continue ?
You don’t need to create the persistence file yourself. You just need to make sure that the path to the persistence file in your home assistant configuration.yaml leads to a directory that exists on your computer and that home assistant can write to that directory. The first time a mysensors sensor reports a value, home assistant will create the persistence file.
Regarding the error to decode the message from the gateway: Make sure that only home assistant is connected to the usb serial gateway device. The serial connection is exclusive, meaning that there will be a problem if two programs try to connect and read from the same serial device at the same time. For example, you can’t have the Arduino IDE serial monitor connected to the gateway at the same time as home assistant is running.
Thanks for helping me out. About the points you raised, I changed the presistence_file to:
persistence_file: 'C:\mysensors.json'
And I still get the error that such file doesn’t exist or it is not readable.So I think now what can be the cause, is that the sensor is not reporting any value which in turn will trigger the HA to create that “mysensors.json” file …
Also, I triple checked and there is no other program that is trying to use same gateway as the HA …