a529987659852 / openwb2mqtt

Home Assistant Integration for openWB (Version 2)
13 stars 4 forks source link

Question: HTTP-API possibility? #26

Open rgrae81 opened 4 weeks ago

rgrae81 commented 4 weeks ago

Hi!

Because of limitation of direct MQTT connection (read/write) maybe it would be a possibility to use the HTTP-API with curl? The Paths are the same like for MQTT, but you don't need to hardcode HomeAssistant and can read and write the same subtree.

just a thought Roman

a529987659852 commented 4 weeks ago

Hi Roman, I don't get how you want to use curl in a custom component? AFIK, curl is a command line tool. Other integrations that use web APIs develop a controller that executes the API call directly in the python code.

Anyway, since MQTT has been running stable for some time, I'm not likely to change the integration architecture.

But nevertheless, thanks for bringing that thought up.

Andreas

rgrae81 @.***> schrieb am Di., 29. Okt. 2024, 17:41:

Hi!

Because of limitation of direct MQTT connection (read/write) maybe it would be a possibility to use the HTTP-API with curl? The Paths are the same like for MQTT, but you don't need to hardcode HomeAssistant and can read and write the same subtree.

just a thought Roman

— Reply to this email directly, view it on GitHub https://github.com/a529987659852/openwb2mqtt/issues/26, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQTMJRDVRJBNWZHHDWEKWWLZ563EFAVCNFSM6AAAAABQ2JCVLWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYZDCOBQGEYTGNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rgrae81 commented 4 weeks ago

Sry, didn't know that curl is not possible in a component. reating is also possible through HTTP Post.

I was thinking about it because you need to define in and out in the mqtt bridge and it's not working to read the whole topic and write to a subtopic of it. So this config is tricky.

Maybe you could do all the readings by http request and the writings by mqtt.

still just brainstorming ;-) I like your component and your work pls keep in mind :-)

by the way, in your documentation ther is:

Sensors per Chargepoint

TODO: Replace 4 by your chargepoint ID

topic openWB/chargepoint/4/get/# in topic openWB/chargepoint/4/config in

if you change 4 to + then you don't need 2 lines per chargepoint.