Page 1 of 1

OpenEVSE MQTT Plugin

Posted: Tuesday 14 April 2020 17:43
by ayasystems
I have done the "OpenEVSE MQTT Plugin" enjoy it

https://github.com/ayasystems/OpenEVSEPlugin/
openevse_plugin.jpg
openevse_plugin.jpg (99.09 KiB) Viewed 2289 times

Re: OpenEVSE MQTT Plugin

Posted: Friday 17 April 2020 19:17
by renerene
Thank you, looks promosing.

Can not get the OpenEVSE to connect 'Entramos en nuestro OpenEVSE por IP'
https://domotuto.com/integracion-domoti ... evse-mqtt/: after clicking 'saved' in http://192.168.0.xxx/#services it says 'Connected: NO'
Do I need to activate some general MQTT service in domoticz first or just installing your plugin?

2) Domoticz side: what is the port number in the hardware settings? Can not check it in OpenEVSE. I assume '1883' is default?

Re: OpenEVSE MQTT Plugin

Posted: Saturday 18 April 2020 10:08
by renerene
additional to post above.
maybe this is the cause:

Code: Select all

 2020-04-18 10:05:25.180 Error: Error parsing http request.
2020-04-18 10:05:25.230 Error: (ProcessInbound) MQTT protocol violation: Invalid message flags 8 for packet type '4'
2020-04-18 10:05:25.231 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2020-04-18 10:05:25.231 Error: (OpenEVSE) 'onMessage' failed 'TypeError':'a bytes-like object is required, not 'str''.
2020-04-18 10:05:25.231 Error: (OpenEVSE) ----> Line 309 in '/home/pi/domoticz/plugins/OpenEVSEPlugin/plugin.py', function onMessage
2020-04-18 10:05:25.231 Error: (OpenEVSE) ----> Line 278 in '/home/pi/domoticz/plugins/OpenEVSEPlugin/plugin.py', function onMessage
2020-04-18 10:05:25.231 Error: (OpenEVSE) ----> Line 155 in '/home/pi/domoticz/plugins/OpenEVSEPlugin/mqtt.py', function onMessage 

Code: Select all

2020-04-18 18:46:31.199 (OpenEVSE) Heartbeating...False
2020-04-18 18:46:31.199 (OpenEVSE) Reconnecting
2020-04-18 18:46:31.199 (OpenEVSE) MqttClient::open
2020-04-18 18:46:31.199 (OpenEVSE) MqttClient::close
2020-04-18 18:46:31.199 (OpenEVSE) Deallocating connection object '127.0.0.1' (127.0.0.1:1883).
2020-04-18 18:46:31.199 (OpenEVSE) Protocol set to: 'MQTT'.
2020-04-18 18:46:31.199 (OpenEVSE) Transport set to: 'TCP/IP', 127.0.0.1:1883.
2020-04-18 18:46:31.199 (OpenEVSE) Connect directive received, action initiated successfully.
2020-04-18 18:46:31.249 (OpenEVSE) Failed to connect (111) to: 127.0.0.1:1883 with error: Connection refused
2020-04-18 18:46:31.250 (OpenEVSE) Disconnect event received for '127.0.0.1:1883'.
2020-04-18 18:46:31.250 (OpenEVSE) onDisconnect called 
2) found out that 1883 is default port for OpenEVSE, so question 2 is answered.

Re: OpenEVSE MQTT Plugin

Posted: Saturday 18 April 2020 19:04
by renerene
Success!

Turned out you need to install mosquitto first.
http://mosquitto.org/blog/2013/01/mosqu ... epository/

Code: Select all

sudo apt-get update
sudo apt-get install mosquitto

Re: OpenEVSE MQTT Plugin

Posted: Wednesday 20 May 2020 16:15
by ayasystems
Sorry for delayed answer and thanks for your feedback

I can see that you have it working now...!

Regards!

Re: OpenEVSE MQTT Plugin

Posted: Tuesday 27 December 2022 9:54
by renerene
Hello, with a fresh install of Domoticz on Bullseye, and after following the git clone steps with domoticz restart, the "OpenEVSE mqtt plugin" hardware type is not showing in the pull-down list on the domoticz hardware section.

Folder /home/pi/domoticz/plugins/OpenEVSEPlugin/ is created and has 5 files
Any ideas?

My Domoticz version:
Version: 2022.2
Build Hash: eea9db734
Compile Date: 2022-11-05 13:05:35
dzVents Version: 3.1.8
Python Version: None

Re: OpenEVSE MQTT Plugin

Posted: Tuesday 27 December 2022 10:08
by waltervl
renerene wrote: Tuesday 27 December 2022 9:54
Any ideas?

Python Version: None
You do not have Python installed (correctly) on your server.
Check wiki page https://www.domoticz.com/wiki/Using_Python_plugins

Re: OpenEVSE MQTT Plugin

Posted: Tuesday 27 December 2022 10:24
by renerene
yes, there was a problem with Python. Thank you. Plugin now avaulable.
Still not working. Temperature sensor is updated at domoticz startup time, but value is wrong and no temp updates


Domoticz Log
2022-12-27 10:08:12.079 Error: OpenEVSE: Last data: 89.3995623588562
2022-12-27 10:16:01.066 Error: OpenEVSE: Last data: 89.26790380477905
2022-12-27 10:16:24.682 Status: OpenEVSE: Stop directive received.
2022-12-27 10:16:24.697 Status: OpenEVSE: Exiting work loop.
2022-12-27 10:16:24.782 Status: OpenEVSE: Stopping threads.
2022-12-27 10:16:24.782 Status: OpenEVSE: Stopped.
2022-12-27 10:16:24.782 Status: OpenEVSE: Entering work loop.
2022-12-27 10:16:24.783 Status: OpenEVSE: Started.
2022-12-27 10:16:24.934 Status: OpenEVSE: Initialized version 1.0.6, author 'EA4GKQ Ángel'
2022-12-27 10:17:11.150 Status: OpenEVSE: Stop directive received.
2022-12-27 10:17:11.162 Status: OpenEVSE: Exiting work loop.
2022-12-27 10:17:11.250 Status: OpenEVSE: Stopping threads.
2022-12-27 10:17:11.250 Status: OpenEVSE: Stopped.
2022-12-27 10:17:11.250 Status: OpenEVSE: Entering work loop.
2022-12-27 10:17:11.251 Status: OpenEVSE: Started.
2022-12-27 10:17:11.505 Status: OpenEVSE: Initialized version 1.0.6, author 'EA4GKQ Ángel'
2022-12-27 10:18:41.088 Error: OpenEVSE: Last data: 89.58361101150513
2022-12-27 10:22:52.688 Status: OpenEVSE: Stop directive received.
2022-12-27 10:22:52.702 Status: OpenEVSE: Exiting work loop.
2022-12-27 10:22:52.788 Status: OpenEVSE: Stopping threads.
2022-12-27 10:22:52.788 Status: OpenEVSE: Stopped.
2022-12-27 10:22:52.789 Status: OpenEVSE: Entering work loop.
2022-12-27 10:22:52.789 Status: OpenEVSE: Started.
2022-12-27 10:22:53.047 Status: OpenEVSE: Initialized version 1.0.6, author 'EA4GKQ Ángel'
2022-12-27 10:24:22.087 Error: OpenEVSE: Last data: 89.04140567779541
Image
Image

Re: OpenEVSE MQTT Plugin

Posted: Tuesday 27 December 2022 17:35
by gizmocuz
Maybe it would be an idea to do the documentation in English?
The main page says ESP322 ... Does this exist? Could be my French

Re: OpenEVSE MQTT Plugin

Posted: Tuesday 27 December 2022 21:46
by renerene
ah, finally got my temperature working

Tips:
1) https://www.domoticz.com/wiki/MQTT#Architecture
Warning: from Mosquitto v2.0.x you need extra configuration, else no connection is made with Domoticz see also viewtopic.php?f=28&t=35706
To see your installed version:
mosquitto -h | grep version
To fix this edit the /etc/mosquitto/mosquitto.conf file and add:
listener 1883
allow_anonymous true

2) check if your MQQT commands are coming in:

Code: Select all

pi@raspberrypi:~ $ mosquitto_sub -v -t OpenEVSE/#
OpenEVSE/amp 7480
OpenEVSE/wh 18480341
OpenEVSE/temp1 132
OpenEVSE/temp2 -2560
OpenEVSE/temp3 -2560
OpenEVSE/pilot 8
OpenEVSE/state 3
OpenEVSE/freeram 26984
OpenEVSE/divertmode 1
3) modify aroud line 140 in /home/pi/domoticz/plugins/OpenEVSEPlugin/plugin.py "temp" --> "temp1":

Code: Select all

              #modified 2022-12-27 , see https://www.domoticz.com/forum/posting.php?mode=reply&t=32189
              #OLD: if (mqttpath[1] == "temp"): 
              if (mqttpath[1] == "temp1"):
                unitname="Temp"
                subval="temp"

Re: OpenEVSE MQTT Plugin

Posted: Monday 02 January 2023 11:37
by ayasystems
gizmocuz wrote: Tuesday 27 December 2022 17:35 Maybe it would be an idea to do the documentation in English?
The main page says ESP322 ... Does this exist? Could be my French
Could you help to make an English documentation? Any help is welcome

Re: OpenEVSE MQTT Plugin

Posted: Monday 02 January 2023 12:37
by gizmocuz
ayasystems wrote: Monday 02 January 2023 11:37 Could you help to make an English documentation? Any help is welcome
I think everyone creating software (c++/vb/scripts) should program in English

For example, there are some great open-source projects in Chinese, Zulu, French ....

But that's just my 2 cents :mrgreen:

Re: OpenEVSE MQTT Plugin

Posted: Monday 02 January 2023 12:54
by ayasystems
Could be better collaborate than request. working together

Re: OpenEVSE MQTT Plugin

Posted: Monday 02 January 2023 13:53
by waltervl
Problem is that our Spanish is not that well...
You can try to use the google page translation module on your website to have google translate it for you. There are wordpress plugins for that.
For the github page you can have google translate do the basic translation for you and you can fine tune it.

Re: OpenEVSE MQTT Plugin

Posted: Monday 02 January 2023 22:21
by ayasystems
You also can use the google translate ... Sorry man.

Re: OpenEVSE MQTT Plugin

Posted: Monday 02 January 2023 22:30
by waltervl
ayasystems wrote: Monday 02 January 2023 22:21 You also can use the google translate ... Sorry man.
Indeed, but if you want a bigger audience for your hard work creating a nice plugin we only advise you to create an English manual. We cannot help (as being Dutch) because we are not good enough in Spanish language.

Re: OpenEVSE MQTT Plugin

Posted: Monday 02 January 2023 22:41
by ayasystems
People want things without contributing anything. Only 3 stars on git hub. My English is also not good enough to do documentation, so I need help for it.

Mensen willen dingen zonder iets bij te dragen. Slechts 3 sterren op git hub. Mijn Engels is ook niet goed genoeg om documentatie te doen, dus daar heb ik hulp bij nodig.

Die Leute wollen Dinge, ohne etwas beizutragen. Nur 3 Sterne auf Git Hub. Mein Englisch ist auch nicht gut genug, um Dokumentation zu machen, also brauche ich Hilfe dafür.

Re: OpenEVSE MQTT Plugin

Posted: Thursday 28 December 2023 11:04
by paede
Hi
Is it possible with your plugin to limit the charging current, so that I can use the surplus power from the solar system to charge the electric car? Is it possible to switch between single-phase and three-phase charging?

@all: nowadays translation is easy with Chat-GPT :-)

Re: OpenEVSE MQTT Plugin

Posted: Thursday 28 December 2023 13:31
by ayasystems
I don't have time and I'm not going to make any more improvements to the plugin. What has been done is a good starting point for someone to improve and add things