Code Monkey home page Code Monkey logo

powersensor-home-assistant's People

Contributors

blutter avatar izevaka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

blutter leotsyang

powersensor-home-assistant's Issues

socket stream has expired node-red

Hi. Thanks for your work on this integration. I've got a new powersensor, and it's great to be able to get the data into home assistant.
I set this all up the other day, and it was working perfectly, but stopped reporting data after about a day and it appears the culprit was a node-red socket subscription warning, and then expiry. So it was no longer sending anything to mqtt broker.

Apologies if this is not the place to post this (I tried googling fixes for the error to no avail). This is my first flow in node-red, so I'm not sure if there was something extra I needed to set up in node-red to have it continue to listen to and send packets?
Is this to do with the chattiness of the plug/sensors sending so many messages?

I tried restarting node-red and nothing is being sent anymore (nothing in logs other than start-up procedure).

Issue getting this working

Hi,

First of all thank you for doing this! Really awesome to be able to integrate HA and PowerSensor data.

I haven't used NodeRed before and am having trouble getting an MQTT message through. I am not sure if its my lack of NodeRed knowledge or an issue with my PowerSensor.

First of all, the PowerSensor app shows my plug as "live data feed" as active and a "great" wireless signal. I have 1 plug and 2 sensors (meter box and one for solar).

I imported the NodeRed json, configured the IP address of the plug (192.168.1.63) and also configured the nodered global mqtt settings to the existing mqtt broker i have (used for zigbee2mqtt mainly).

I deleted the secondary plug nodes (connect and listen) in the flow.

In nodered, with tracing turned on I can see this in the logs:

14 May 15:55:41 - [info] [udp in:Listen to power plug #1] udp listener at 0.0.0.0:6788
14 May 15:55:41 - [info] [server:Home Assistant] Connecting to http://supervisor/core
14 May 15:55:41 - [info] [mqtt-broker:1dc4d152.a977d7] Connected to broker: mqtt://192.168.1.131:1883
14 May 15:55:41 - [info] [server:Home Assistant] Connected to http://supervisor/core
14 May 15:55:41 - [debug] [server:Home Assistant] States Loaded
14 May 15:55:41 - [debug] [server:Home Assistant] HA State: running
14 May 15:55:41 - [debug] [server:Home Assistant] Services Loaded
14 May 15:55:41 - [info] [udp out:Connect to power plug #1] udp re-use socket: 6788 -> 192.168.1.63:49476
14 May 15:55:41 - [debug] [inject:Start powersensor capture] repeat = 100000
14 May 15:55:45 - [trace] comms.close NJ08ojPVpPF3aTT1ypBhQt2igA+PB3QQF7QhAUedUJo=
14 May 15:57:03 - [trace] comms.open do/WeZzkGhgptJSw6lV1PcuQgAtcxTOB21nrVqkXyT8=
14 May 15:57:13 - [trace] comms.close do/WeZzkGhgptJSw6lV1PcuQgAtcxTOB21nrVqkXyT8=

It feels like this should be working but there are no messages on the mqtt broker when i "start listening" to # (all messages). I also use an mqtt app (mqtt explorer) to see all mqtt messages in a more structured way, and there is nothing there.

Also, the "comms.open" and "comms.close" messages dont really appear frequently like what i expected.

I tried to use the capture-sensor.mjs to ensure the plug connection is there and UDP messages are working, but not getting any meaningful output if i leave it for a while:

r$ node capture-sensor.mjs --raw 192.168.1.63
Scheduled resubscribe
Scheduled resubscribe
Scheduled resubscribe
Scheduled resubscribe
Scheduled resubscribe
Scheduled resubscribe
Scheduled resubscribe
Scheduled resubscribe

So i am not sure if its an issue with the flow config, my mqtt settings or the plug itself.

I used wireshark to inspect the traffic, this is what i see after running for 20 mins (filtered on ipv4 traffic with source or destination as the IP of my plug):
No. Time Source Destination Protocol Length Info
914 -1515.089677 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
2526 -1415.092284 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
3929 -1315.092920 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
15168 -1215.094326 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
16652 -1115.091741 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
18175 -1015.089620 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
19560 -915.087702 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
21011 -815.088554 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
23036 -715.083356 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
24870 -615.080537 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
38394 -515.082067 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
40237 -415.079549 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
42145 -315.077011 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
43812 -215.078230 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
45567 -115.077807 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
47338 -15.076374 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14
38780 -497.041847 192.168.1.63 239.255.193.68 UDP 72 52972 → 49476 Len=30
49404 84.923106 192.168.1.210 192.168.1.63 UDP 56 49429 → 49476 Len=14

Its mostly the sensor (only one for some reason) connecting to the plug with "subscribe 180" messages (source port is 49429, destination port is 49476). The plug connects to an external IP only a couple times in 20 mins, and just sends "calibrate until" messages (source port 52972, destination port 49476). Not sure if that is normal?

I tried looking in wireshark for anything happening over port 6788, but nothing is found.

Any assistance would be appreciated! And sorry if I am missing something really stupid.

Export power

I've just installed solar and unfortunately I am not getting any negative readings from the UDP packets.

@izevaka any ideas on how the official App shows negative export power when solar is exporting yet the power and summation reported through UDP packets are both positive?!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.