Ok, I’ve found out that the hassio installation on the raspberry pi has all ports open as standard so it must be an issue with my config. I set it up as per the instructions (which do look a little inconsistent with other config settings). In my configuration.yaml I have:
lightwaverf_energy:
scan_interval: 30
But this isn’t set up as any particular entity type, could that be the issue?
The yaml is correct. The reason why you dont see any entity types is because the platform( I think thats what they call it) , generates them at runtime… It generates two sensors.
try this piece of python … Its basically listens for messages from the lWRF energy sensor (via the link).
import json
import logging
import socket
import time
data = None
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('0.0.0.0', 9761))
sock.settimeout(30.0) # Wait a Max of 30 seconds
while True:
try:
print("Waiting for data from LWRF Energy Device")
data, _ = sock.recvfrom(1024) # buffer size is 1024 bytes
print("Data received from LWRF Energy %s " % data)
except socket.timeout as ex:
print("No data received ")
run it using python filename.py
It should return some data within 30s (usually comes every 10 seconds). if you dont receive any data then its likely a network issue… The packets are UDP and dont travel through routers other subnets well.
Thanks for your support, however I don’t know how to run this. I’m assuming I save it as a .py file on my raspberrypi and then run it using the cli. The issue I have is that i’m running home assistant through hass.io which I believe is a docker installation and I have no access to the raspberry pi that the hass.io installation is running on. I can only get to/ssh into the docker container itself.
I don’t have the level of understanding to allow me to try different things. I’ve got this far by closely following instructions but haven’t found anything about this sort of thing/obstacle.
so I saved your code snippet as filename.py (couldn’t think of a better name!), put it in /config using the Hassio configurator add on and then set up the sensor as:
Hi…removing the lines and restarting has no effect. The error message is identical.
I have the ssh add-in, but it ssh’s into the container, not the host and the container cli is a cut down version where you have limited options
Regarding the script…that’s exactly what i did
Finally got a load off stuff off my plate and managed to test - My LWRF link has been off since december but now up in the loft and works fine for the energy monitor
Anyway, I have added results pulled on my ubuntu box to the issue open on github for multiple sensors but here they are anyway
Looks like serial number is pulled and can distinguise between multiple monitors
Data received from LWRF Energy *!{“trans”:65,“mac”:“20:40:A8”,“time”:1591027715,“pkt”:“868R”,“fn”:“meterData”,“prod”:“pwrMtr”,“serial”:“DB81FE”,“type”:“energy”,“cUse”:1350,“todUse”:187}
Data received from LWRF Energy *!{“trans”:66,“mac”:“20:40:A8”,“time”:1591027737,“pkt”:“868R”,“fn”:“meterData”,“prod”:“pwrMtr”,“serial”:“CF50FE”,“type”:“energy”,“cUse”:138,“todUse”:14}