MSkjel / LocalPulse2Tibber

80 stars 5 forks source link

Client closes Connection #8

Open helmar74 opened 2 months ago

helmar74 commented 2 months ago

Hi, thank you for the great description. I have a "stand alone" mosquitto Installation and configured everything like described. If I restart mosquitto i get this error messages in a loop:

1713535274: Connecting bridge (step 1) bridge-to-tibber (a1zhmn1192zl1a.iot.eu-west-1.amazonaws.com:8883)
1713535274: Connecting bridge (step 2) bridge-to-tibber (a1zhmn1192zl1a.iot.eu-west-1.amazonaws.com:8883)
1713535274: Client local.tibber-pulse-XXXXXX MY ID XXXXXXXXX closed its connection.

So the MQTT Bridge is trying to connect, but fails, as it close the connection

Here's my mosquitto configuration

connection bridge-to-tibber
bridge_cafile /app/tibber/cert/CA.ca
bridge_certfile /app/tibber/cert/Cert.crt
bridge_keyfile /app/tibber/cert/Priv.key
address a1zhmn1192zl1a.iot.eu-west-1.amazonaws.com:8883
clientid tibber-pulse-XXXXXX MY ID XXXXXXXXXXX
try_private false
notifications false

topic $aws/# out
topic tibber-pulse-XXXXXX MY ID XXXXXXXXXXX/receive in

Anyone an idea, what I can try?

Thanks a lot in advance

gareth-ellis commented 1 month ago

I'm seeing the same issue here

gareth-ellis commented 1 month ago

I read a little more about how the AWS IOT service works - I have a feeling that the $aws root topic cannot be subscribed to anymore, which I THINK is what is causing the issues.

I put together a test program using the aws iot client, and with that I can subscribe to the tibber-pulse-XXXXXX MY ID XXXXXXXXXXX/receive in topic without issue. If i try and subscribe to $aws, it closes the connection.

I then went back to trying to get the mqtt bridge to work, I removed the topic $aws/# out line and that still failed. I then realised I had previously enabled notifications, so that I could see the state of the bridge, and found that if I add notifications_local_only true it then "works". (this stops notifications being published to the remote broker, which i guess isn't allowed(

I think the main issue now though is going to be that (at least for me), the information I was interested in was going to be posted to the $aws/# topic tree somewhere. I finally tried including the full address as displayed on the pulse page instead of just $aws/# , ie $aws/rules/push_to_kinesis/tibber-pulse-_my-id_/publish , however whilst the bridge stays up, i don't get any messages through....

I think my next step is to connect my tibber pulse directly to my mqtt broker, and try and have the data go pulse -> my mqtt -> tibber - I'll report back once I get a chance to try

gareth-ellis commented 1 month ago

I managed to get things working now - I was fooled slightly as I run mqtt explorer on my desktop, which apparently doesnt show any topics beginning with $ with the exception of $SYS.

So my final config is:

connection bridge-to-tibber
bridge_cafile /etc/mosquitto/tibber_cert/CA.ca
bridge_certfile /etc/mosquitto/tibber_cert/cert.crt
bridge_keyfile /etc/mosquitto/tibber_cert/priv.key
address a1zhmn1192zl1a.iot.eu-west-1.amazonaws.com:8883
clientid tibber-pulse-XXX1 *i added an extra digit here, it was part of testing, probably isnt needed any more...but just in case
try_private false
notifications true
notifications_local_only true
topic tibber-pulse-XXX/receive in
topic $aws/rules/push_to_kinesis/tibber-pulseXXX/# out

Then my own pulse I configured to point to my local broker, using the same two topics as by default

LoQue90 commented 6 days ago

Hey,

i do have the same problem. Mosquitto Log shows the try to connect from tibber pulse to my broker.

But followed with client closes connection.

I just want the tibber pulse to publish its data to my broker running on my home assistant mashine.

No need to publish anything to tibber.

Do is still need all the mqtt brigde settings?

Thanks for your help!