SmartEvse support

Moderator: leecollings

rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: SmartEvse support

Post by rron »

I don´t use localhost but a fixed ipadres. I use for test mosquitto_sub -v -h 172.18.10.xx -u username -P password -t '#'
The message is connection refused. There's no password en username set. If I use localhost instead of a ipadres the message is also connection refused.
I can ping the address so it doesn't look like a network thing. The rest api does work with the above ip address.
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: SmartEvse support

Post by waltervl »

Why use username and password if you haven't set one in mosquito?
Why use mosquito_pub if you have mqttexplorer already running? It can also send mqtt payloads.
Why not use the mqttmapper plugin directly?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: SmartEvse support

Post by rron »

waltervl wrote: Monday 29 July 2024 20:00 Why use username and password if you haven't set one in mosquito?
Why use mosquito_pub if you have mqttexplorer already running? It can also send mqtt payloads.
Why not use the mqttmapper plugin directly?
I also use it without username and password, no different. The rest of your questions I don’t know, mqtt is a steep learning curve so I will try to find it out.
Mqtt mapper i have installed on the tests version but the part of the json got me confused a bit. :?:
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
DiaDomo
Posts: 37
Joined: Saturday 28 March 2020 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: SmartEvse support

Post by DiaDomo »

@RRon: Do you have these lines in your mosquitto.conf file?

Code: Select all

allow_anonymous true
listener 1883 0.0.0.0
When I send this command:

Code: Select all

mosquitto_sub -v -h 192.168.2.xx  -t '#'
I get a lot of information, like:

Code: Select all

zigbee2mqtt/bridge/state {"state":"online"}
zigbee2mqtt/bridge/info {"commit":"06b3395","config":{"advanced":{"adapter_concurrent":null,"adapter_delay":null,"availability_blacklist":[],"ava
ilability_blocklist":[],"availability_passlist":[],"availability_whitelist":[],"cache_state":true,"cache_state_persistent":true,"cache_state_send
_on_startup":true,"channel":11,"elapsed":false,"ext_pan_id":[221,221,221,221,221,221,221,221],"homeassistant_legacy_entity_attributes":false,"las
t_seen":"disable","legacy_api":false,"legacy_availability_payload":false,"log_directory":"/app/data/log/%TIMESTAMP%","log_file":"log.txt","log_le
vel":"info","log_output":["console","file"],"log_rotation":true,"log_symlink_current":false,"log_syslog":{},"output":"json","pan_id":6754,"report
":false,"soft_reset_timeout":0,"timestamp_format":"YYYY-MM-DD HH:mm:ss"},"availability":{"active":{"timeout":10},"passive":{"timeout":1500}},"blo
cklist":[],"device_options
Maybe this helps..
Raspberry PI 2 & 3 & 4 | RFlink | MySensors | ESP32 | Homebridge | Tasmota Sonoff | Zigbee2Mqtt | ADS-B
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: SmartEvse support

Post by rron »

@ diadomo,

Thank you I will test this and keep you posted .
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: SmartEvse support

Post by rron »

DiaDomo wrote: Tuesday 30 July 2024 9:43 @RRon: Do you have these lines in your mosquitto.conf file?

Code: Select all

allow_anonymous true
listener 1883 0.0.0.0
I have the same

When I send this command:

Code: Select all

mosquitto_sub -v -h 192.168.2.xx  -t '#'
I get a lot of information, like:

Code: Select all

zigbee2mqtt/bridge/state {"state":"online"}
zigbee2mqtt/bridge/info {"commit":"06b3395","config":{"advanced":{"adapter_concurrent":null,"adapter_delay":null,"availability_blacklist":[],"ava
ilability_blocklist":[],"availability_passlist":[],"availability_whitelist":[],"cache_state":true,"cache_state_persistent":true,"cache_state_send
_on_startup":true,"channel":11,"elapsed":false,"ext_pan_id":[221,221,221,221,221,221,221,221],"homeassistant_legacy_entity_attributes":false,"las
t_seen":"disable","legacy_api":false,"legacy_availability_payload":false,"log_directory":"/app/data/log/%TIMESTAMP%","log_file":"log.txt","log_le
vel":"info","log_output":["console","file"],"log_rotation":true,"log_symlink_current":false,"log_syslog":{},"output":"json","pan_id":6754,"report
":false,"soft_reset_timeout":0,"timestamp_format":"YYYY-MM-DD HH:mm:ss"},"availability":{"active":{"timeout":10},"passive":{"timeout":1500}},"blo
cklist":[],"device_options
Maybe this helps..
mosquitto_sub -v -h 192.168.178.xx -t´#'
give me:

Code: Select all

zwave/Magnetron/meter/endpoint_0/value/66817 {"time":1722448030888,"value":0,"nodeName":"Magnetron","nodeLocation":"Keuken"}
zwave/Vaatwasser/lastActive {"time":1722448030954,"value":1722448030704}
zwave/Magnetron/lastActive {"time":1722448031135,"value":1722448030884}
zwave/Vaatwasser/lastActive {"time":1722448031535,"value":1722448031535}
zwave/Vaatwasser/meter/endpoint_0/value/66817 {"time":1722448031539,"value":0,"nodeName":"Vaatwasser","nodeLocation":"Keuken"}
zwave/Vaatwasser/lastActive {"time":1722448031786,"value":1722448031535}
domoticz/MainsCurrentL1 -7
domoticz/MainsCurrentL2 0
domoticz/MainsCurrentL3 0
domoticz/ESPUptime 284401
domoticz/ESPTemp 41
domoticz/Mode Normal
domoticz/MaxCurrent 160
domoticz/ChargeCurrent 160
domoticz/ChargeCurrentOverride 0
domoticz/Access Allow
domoticz/RFID Not Installed
domoticz/State Ready to Charge
domoticz/Error None
domoticz/EVPlugState Disconnected
the last part is from smartevse and that looks different and I can´t make that visible in domoticz because there's no payload in json format(i have red that in the mqttmapper docs) :?:
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: SmartEvse support

Post by waltervl »

Did you ask that in the mqttmapper topic? As I do not read that....
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: SmartEvse support

Post by rron »

I will do that.
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
FlyingDomotic
Posts: 303
Joined: Saturday 27 February 2016 0:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: SmartEvse support

Post by FlyingDomotic »

To answer for MqttMapper, the first thing is known what you want to get in Domoticz, and want you want to set in SmartEvse.

Reading this thread, I found a reference to https://github.com/sandervandegeijn/mqt ... rtevse.ino. Is it the code you're using to set MQTT?

Have you any reference to the code which write data from SmartEvse to Domoticz?

And FYI, there's no need to have JSON formatted topics, MQTTMapper can read raw data, as long it's in MQTT topic.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: SmartEvse support

Post by waltervl »

It seems a little bit documented here: https://github.com/SmartEVSE/SmartEVSE- ... d#mqtt-api
Only rron is using a fork https://github.com/serkri/SmartEVSE-3 but that is already 400 commits behind of the original. And mqtt seems implemented but not documented in that fork
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: SmartEvse support

Post by rron »

FlyingDomotic wrote: Thursday 01 August 2024 2:19 To answer for MqttMapper, the first thing is known what you want to get in Domoticz, and want you want to set in SmartEvse.

Reading this thread, I found a reference to https://github.com/sandervandegeijn/mqt ... rtevse.ino. Is it the code you're using to set MQTT?

Have you any reference to the code which write data from SmartEvse to Domoticz?

And FYI, there's no need to have JSON formatted topics, MQTTMapper can read raw data, as long it's in MQTT topic.
I want to see the charge current and temperature error charge status in domoticz. I have not used the code from Sander but the serkri firmware which also should be possible to send the messages.
And if it's working i want also to set current from domoticz to smartevse. The screendump is the information from smartevse raw dump.
waltervl wrote: Thursday 01 August 2024 10:13 It seems a little bit documented here: https://github.com/SmartEVSE/SmartEVSE- ... d#mqtt-api
Only rron is using a fork https://github.com/serkri/SmartEVSE-3 but that is already 400 commits behind of the original. And mqtt seems implemented but not documented in that fork
That's correct that I ḿ using a fork but the fork is ahead from the original software. I ḿ at this moment on the latest release firm release 3.6.7
Attachments
Schermafdruk van 2024-08-01 19-29-17.png
Schermafdruk van 2024-08-01 19-29-17.png (95.57 KiB) Viewed 1011 times
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: SmartEvse support

Post by waltervl »

Strange, serki GitHub tags only goes to 1.8.0, original 3.6.2
But when it works it works...

It is better to change the mqtt prefix to something else then the current "domoticz" as it no Domoticz information but smartevse data.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: SmartEvse support

Post by rron »

Your right i will chang that.
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
DiaDomo
Posts: 37
Joined: Saturday 28 March 2020 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: SmartEvse support

Post by DiaDomo »

Hi rron,
Which repository are you using?
I can found via google these:
https://github.com/serkri/SmartEVSE-3 => release v1.8.0
https://github.com/SmartEVSE/SmartEVSE-3 => release v3.6.2 (last change by dingo35)

But I cannot find not release v3.6.7?
Edit: I found it:
https://github.com/dingo35/SmartEVSE-3.5 => release 3.6.7

Many versions? Which can be considered as stable?
Raspberry PI 2 & 3 & 4 | RFlink | MySensors | ESP32 | Homebridge | Tasmota Sonoff | Zigbee2Mqtt | ADS-B
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: SmartEvse support

Post by rron »

Rel 3.6.7 is stable bur still no information in domoticz, that still has not resolved.
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
FlyingDomotic
Posts: 303
Joined: Saturday 27 February 2016 0:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: SmartEvse support

Post by FlyingDomotic »

waltervl wrote: Thursday 01 August 2024 10:13 It seems a little bit documented here: https://github.com/SmartEVSE/SmartEVSE- ... d#mqtt-api
Only rron is using a fork github.com/serkri/SmartEVSE-3 but that is already 400 commits behind of the original. And mqtt seems implemented but not documented in that fork
Thanks for pointer.

*** This part relates to https://github.com/SmartEVSE/SmartEVSE-3 ***

I started to work with it. Would it be possible to get a dump of *all* topics related with dingo35 fork?

As per code, it seems you can read the following topics ([MQTTprefix] to be replaced by value stored in ESP preferences, defaulting to SmartEVSE-nnnnnn):
- [MQTTprefix]/connected
- [MQTTprefix]/MainsCurrentL1
- [MQTTprefix]/MainsCurrentL2
- [MQTTprefix]/MainsCurrentL3
- [MQTTprefix]/EVCurrentL1
- [MQTTprefix]/EVCurrentL2
- [MQTTprefix]/EVCurrentL3
- [MQTTprefix]/ESPUptime
- [MQTTprefix]/ESPTemp
- [MQTTprefix]/Mode
- [MQTTprefix]/MaxCurrent
- [MQTTprefix]/ChargeCurrent
- [MQTTprefix]/ChargeCurrentOverride
- [MQTTprefix]/Access
- [MQTTprefix]/RFID
- [MQTTprefix]/RFIDLastRead
- [MQTTprefix]/State
- [MQTTprefix]/Error
- [MQTTprefix]/EVPlugState
- [MQTTprefix]/WiFiSSID
- [MQTTprefix]/WiFiBSSID
- [MQTTprefix]/WiFiRSSI
- [MQTTprefix]/CPPWM
- [MQTTprefix]/CPPWMOverride
- [MQTTprefix]/EVInitialSoC
- [MQTTprefix]/EVFullSoC
- [MQTTprefix]/EVComputedSoC
- [MQTTprefix]/EVRemainingSoC
- [MQTTprefix]/EVTimeUntilFull
- [MQTTprefix]/EVEnergyCapacity
- [MQTTprefix]/EVEnergyRequest
- [MQTTprefix]/EVCCID
- [MQTTprefix]/RequiredEVCCID
- [MQTTprefix]/EVChargePower
- [MQTTprefix]/EVEnergyCharged
- [MQTTprefix]/EVTotalEnergyCharged
- [MQTTprefix]/HomeBatteryCurrent
- [MQTTprefix]/OCPP
- [MQTTprefix]/OCPPConnection

It also seems that you can set the following topics to change things on SmartEVSE (same remark as previously about [MQTTprefix]):
- [MQTTprefix]/Set/Mode
- [MQTTprefix]/Set/CurrentOverride
- [MQTTprefix]/Set/CurrentMaxSumMains
- [MQTTprefix]/Set/CPPWMOverride
- [MQTTprefix]/Set/MainsMeter
- [MQTTprefix]/Set/EVMeter
- [MQTTprefix]/Set/HomeBatteryCurrent
- [MQTTprefix]/Set/RequiredEVCCID

First of all, you must know that MqttMqpper configuration is done through a json file, default name being MqttMqpper.json. You should create this file in MqttMapper plugin folder (commonly /home/pi/Domoticz/plugins/MqttMapper)

Here are some examples showing how to configure this JSON file for SmartEVSE:

For everything related to current (which are in 0.1 A steps), use the following template:

Code: Select all

{
    "SmartEVSE charge current": {
        "topic": "[MQTTprefix]/Charge Current",
        "type": "243", "subtype": "23", "switchtype": "0",
        "mapping": {"item": "", "multiplier": 0.1}
    }
}
This will create a 1 phase current device (243/23) named "SmartEVSE charge Current", giving "[MQTTprefix]/Charge Current" topic, without mapping ("item": "" -> data is raw), multiplying value by 0.1 (dividing by 10)

To do the same for "MaxCurrent", use:

Code: Select all

{
    "SmartEVSE max current": {
        "topic": "[MQTTprefix]/Max Current",
        "type": "243", "subtype": "23", "switchtype": "0",
        "mapping": {"item": "", "multiplier": 0.1}
    }
}
To load a text value (for example "State") into a text, use:

Code: Select all

{
    "SmartEVSE state": {
        "topic": "[MQTTprefix]/State",
        "type": "243", "subtype": "19", "switchtype": "0",
        "mapping": {"item": ""}
    }
}
For text value having less than 10 values (for example "Status"), you can also use a selector, as:

Code: Select all

    "SmartEVSE status": {
        "topic": "[MQTTprefix]/Status",
        "type": "244", "subtype": "73", "switchtype": "18",
        "options": {"SelectorStyle":"1", "LevelOffHidden": "false", "LevelNames":"None|No Power Available|Communication Error|Temperature High|EV Meter Comm Error|RCM Tripped|Waiting for Solar|Test IO|Flash Error|**Unknown**"},
        "mapping": {"item": "", "default": "90",
            "values": {
                "None": "0",
                "No Power Available": "10",
                "Communication Error": "20",
                "Temperature High": "30",
                "EV Meter Comm Error": "40",
                "RCM Tripped": "50",
                "Waiting for Solar": "60",
                "Test IO": "70",
                "Flash Error": "80",
                "**Unknown**": "90"
                }
            }
    }
Details about Domoticz supported types, subtypes and switchtypes are at https://www.domoticz.com/wiki/Developin ... vice_Types. For most of devices, finding the right Domoticz device and the correct topic will be sufficient.

Mainly, options here allow to put device specific parameters. Here "SelectorStyle":"1" to ask for a drop-down list (instead of a set of buttons), "LevelOffHidden": "false" to show level off (0) and "LevelNames" to specify list of level labels starting to "0". Note that these labels will be displayed by Domoticz, and can be different of those in MQTT (especially if your native language is not English).

"Values" does mapping between (text) values in MQTT and Domoticz selector levels (from 0 to 100 by 10 steps).

For advanced settings, have a look to https://github.com/FlyingDomotic/domoti ... per-plugin.

To set values, Domoticz obviously is not well equipped to change something from Web UI. There's only SetPoint, extended in 2023.2. If you're using this version, or newer, you can use :

Code: Select all

    "SmartEVSE charge current override": {
        "topic": "[MQTTprefix]/ChargeCurrentOverride",
        "type": "242", "subtype": "1", "switchtype": "0",
        "options": {"ValueStep": "0.1", "ValueMin": "0", "ValueMax": "200", "ValueUnit": "A"},
        "initial": {"nvalue": "0", "svalue": "0"},
        "mapping": {"item": "", "multiplier": 0.1},
        "set": {"topic": "[MQTTprefix]/Set/CurrentOverride", "digits": 0}
    }
Topics, types and mapping are set as previously. Options are specific to device types (and given by Domoticz doc).

"Set" give topic to use when setting value (can be different of source topic as here).

"Digits" indicates number of digits after decimal point (here 0, truncate to integer).

"Initial" allows to set nValue and sValue to starting values at device creation (as SetPoint is created with a default value of 30.0 (internally 300)

Before 2023.2, idea is to use a "classical" device, and change it from a script:

Code: Select all

    "SmartEVSE charge current override (legacy)": {
        "topic": "[MQTTprefix]/ChargeCurrentOverride",
        "type": "244", "subtype": "73", "switchtype": "0",
        "mapping": {"item": "", "multiplier": 0.1},
        "set": {"topic": "[MQTTprefix]/Set/CurrentOverride", "digits": 0}
    }
Don't forget to replace [MQTTprefix] by your installation prefix.

You may use this thread to ask questions ;-)
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: SmartEvse support

Post by rron »

@ Flying Domotica,thank you very much for your effort.I,’ m going to test this weekend and let you know how it goes
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
FlyingDomotic
Posts: 303
Joined: Saturday 27 February 2016 0:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: SmartEvse support

Post by FlyingDomotic »

You're welcome!

Meantime, I checked that dingo35 fork was compatible in term of MQTT topic with original code.

God news: it is!

The only condition at compile time (is I correctly understood), is to define MQTT (to any value). You'll probably have to define then MQTT server settings in preferences, when running code.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: SmartEvse support

Post by waltervl »

FlyingDomotic wrote: Friday 02 August 2024 17:10 To set values, Domoticz obviously is not well equipped to change something from Web UI. There's only SetPoint, extended in 2023.2. If you're using this version, or newer, you can use :

You may use this thread to ask questions ;-)
Thanks for detailed description. Not fully agree with above information
The setpoint device is now ideally for setting values. You can define delta, min and max values and also set the unit of measure (Ampère, Celcius, Voltage etc).

To set states besides the obvious On/Off you can use the selector switch. Use this for example to set charging modes. You can also use this to indicate and set states.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: SmartEvse support

Post by rron »

FlyingDomotic wrote: Friday 02 August 2024 17:10
waltervl wrote: Thursday 01 August 2024 10:13 It seems a little bit documented here: https://github.com/SmartEVSE/SmartEVSE- ... d#mqtt-api
Only rron is using a fork github.com/serkri/SmartEVSE-3 but that is already 400 commits behind of the original. And mqtt seems implemented but not documented in that fork
Thanks for pointer.

*** This part relates to https://github.com/SmartEVSE/SmartEVSE-3 ***

I started to work with it. Would it be possible to get a dump of *all* topics related with dingo35 fork?

As per code, it seems you can read the following topics ([MQTTprefix] to be replaced by value stored in ESP preferences, defaulting to SmartEVSE-nnnnnn):
- [MQTTprefix]/connected
- [MQTTprefix]/MainsCurrentL1
- [MQTTprefix]/MainsCurrentL2
- [MQTTprefix]/MainsCurrentL3
- [MQTTprefix]/EVCurrentL1
- [MQTTprefix]/EVCurrentL2
- [MQTTprefix]/EVCurrentL3
- [MQTTprefix]/ESPUptime
- [MQTTprefix]/ESPTemp
- [MQTTprefix]/Mode
- [MQTTprefix]/MaxCurrent
- [MQTTprefix]/ChargeCurrent
- [MQTTprefix]/ChargeCurrentOverride
- [MQTTprefix]/Access
- [MQTTprefix]/RFID
- [MQTTprefix]/RFIDLastRead
- [MQTTprefix]/State
- [MQTTprefix]/Error
- [MQTTprefix]/EVPlugState
- [MQTTprefix]/WiFiSSID
- [MQTTprefix]/WiFiBSSID
- [MQTTprefix]/WiFiRSSI
- [MQTTprefix]/CPPWM
- [MQTTprefix]/CPPWMOverride
- [MQTTprefix]/EVInitialSoC
- [MQTTprefix]/EVFullSoC
- [MQTTprefix]/EVComputedSoC
- [MQTTprefix]/EVRemainingSoC
- [MQTTprefix]/EVTimeUntilFull
- [MQTTprefix]/EVEnergyCapacity
- [MQTTprefix]/EVEnergyRequest
- [MQTTprefix]/EVCCID
- [MQTTprefix]/RequiredEVCCID
- [MQTTprefix]/EVChargePower
- [MQTTprefix]/EVEnergyCharged
- [MQTTprefix]/EVTotalEnergyCharged
- [MQTTprefix]/HomeBatteryCurrent
- [MQTTprefix]/OCPP
- [MQTTprefix]/OCPPConnection

It also seems that you can set the following topics to change things on SmartEVSE (same remark as previously about [MQTTprefix]):
- [MQTTprefix]/Set/Mode
- [MQTTprefix]/Set/CurrentOverride
- [MQTTprefix]/Set/CurrentMaxSumMains
- [MQTTprefix]/Set/CPPWMOverride
- [MQTTprefix]/Set/MainsMeter
- [MQTTprefix]/Set/EVMeter
- [MQTTprefix]/Set/HomeBatteryCurrent
- [MQTTprefix]/Set/RequiredEVCCID

First of all, you must know that MqttMqpper configuration is done through a json file, default name being MqttMqpper.json. You should create this file in MqttMapper plugin folder (commonly /home/pi/Domoticz/plugins/MqttMapper)

Here are some examples showing how to configure this JSON file for SmartEVSE:

For everything related to current (which are in 0.1 A steps), use the following template:

Code: Select all

{
    "SmartEVSE charge current": {
        "topic": "[MQTTprefix]/Charge Current",
        "type": "243", "subtype": "23", "switchtype": "0",
        "mapping": {"item": "", "multiplier": 0.1}
    }
}
This will create a 1 phase current device (243/23) named "SmartEVSE charge Current", giving "[MQTTprefix]/Charge Current" topic, without mapping ("item": "" -> data is raw), multiplying value by 0.1 (dividing by 10)

To do the same for "MaxCurrent", use:

Code: Select all

{
    "SmartEVSE max current": {
        "topic": "[MQTTprefix]/Max Current",
        "type": "243", "subtype": "23", "switchtype": "0",
        "mapping": {"item": "", "multiplier": 0.1}
    }
}
To load a text value (for example "State") into a text, use:

Code: Select all

{
    "SmartEVSE state": {
        "topic": "[MQTTprefix]/State",
        "type": "243", "subtype": "19", "switchtype": "0",
        "mapping": {"item": ""}
    }
}
For text value having less than 10 values (for example "Status"), you can also use a selector, as:

Code: Select all

    "SmartEVSE status": {
        "topic": "[MQTTprefix]/Status",
        "type": "244", "subtype": "73", "switchtype": "18",
        "options": {"SelectorStyle":"1", "LevelOffHidden": "false", "LevelNames":"None|No Power Available|Communication Error|Temperature High|EV Meter Comm Error|RCM Tripped|Waiting for Solar|Test IO|Flash Error|**Unknown**"},
        "mapping": {"item": "", "default": "90",
            "values": {
                "None": "0",
                "No Power Available": "10",
                "Communication Error": "20",
                "Temperature High": "30",
                "EV Meter Comm Error": "40",
                "RCM Tripped": "50",
                "Waiting for Solar": "60",
                "Test IO": "70",
                "Flash Error": "80",
                "**Unknown**": "90"
                }
            }
    }
Details about Domoticz supported types, subtypes and switchtypes are at https://www.domoticz.com/wiki/Developin ... vice_Types. For most of devices, finding the right Domoticz device and the correct topic will be sufficient.

Mainly, options here allow to put device specific parameters. Here "SelectorStyle":"1" to ask for a drop-down list (instead of a set of buttons), "LevelOffHidden": "false" to show level off (0) and "LevelNames" to specify list of level labels starting to "0". Note that these labels will be displayed by Domoticz, and can be different of those in MQTT (especially if your native language is not English).

"Values" does mapping between (text) values in MQTT and Domoticz selector levels (from 0 to 100 by 10 steps).

For advanced settings, have a look to https://github.com/FlyingDomotic/domoti ... per-plugin.

To set values, Domoticz obviously is not well equipped to change something from Web UI. There's only SetPoint, extended in 2023.2. If you're using this version, or newer, you can use :

Code: Select all

    "SmartEVSE charge current override": {
        "topic": "[MQTTprefix]/ChargeCurrentOverride",
        "type": "242", "subtype": "1", "switchtype": "0",
        "options": {"ValueStep": "0.1", "ValueMin": "0", "ValueMax": "200", "ValueUnit": "A"},
        "initial": {"nvalue": "0", "svalue": "0"},
        "mapping": {"item": "", "multiplier": 0.1},
        "set": {"topic": "[MQTTprefix]/Set/CurrentOverride", "digits": 0}
    }
Topics, types and mapping are set as previously. Options are specific to device types (and given by Domoticz doc).

"Set" give topic to use when setting value (can be different of source topic as here).

"Digits" indicates number of digits after decimal point (here 0, truncate to integer).

"Initial" allows to set nValue and sValue to starting values at device creation (as SetPoint is created with a default value of 30.0 (internally 300)

Before 2023.2, idea is to use a "classical" device, and change it from a script:

Code: Select all

    "SmartEVSE charge current override (legacy)": {
        "topic": "[MQTTprefix]/ChargeCurrentOverride",
        "type": "244", "subtype": "73", "switchtype": "0",
        "mapping": {"item": "", "multiplier": 0.1},
        "set": {"topic": "[MQTTprefix]/Set/CurrentOverride", "digits": 0}
    }
Don't forget to replace [MQTTprefix] by your installation prefix.

You may use this thread to ask questions ;-)
I 'm sorry but I ḿ not very familiar with json so I use the online json editor and this is the outcome:

Code: Select all

[[
  {
    "SmartEVSE charge current": {
      "topic": "[MQTTprefix]/Charge Current",
      "type": "243",
      "subtype": "23",
      "switchtype": "0",
      "mapping": {
        "item": "",
        "multiplier": 0.1
      }
    }
  },
  {
    "SmartEVSE max current": {
      "topic": "[MQTTprefix]/Max Current",
      "type": "243",
      "subtype": "23",
      "switchtype": "0",
      "mapping": {
        "item": "",
        "multiplier": 0.1
      }
    }
  },
  {
    "SmartEVSE state": {
      "topic": "[MQTTprefix]/State",
      "type": "243",
      "subtype": "19",
      "switchtype": "0",
      "mapping": {
        "item": ""
      }
    }
  }
]/code]


But domoticz give the following errors:


[code][ 2024-08-04 13:32:50.281 Error: mapper: Call to function 'onStart' failed, exception details:
2024-08-04 13:32:50.289 Error: mapper: Traceback (most recent call last):
2024-08-04 13:32:50.289 Error: mapper: File "/opt/domoticz/userdata/plugins/MqttMapper/plugin.py", line 638, in onStart
2024-08-04 13:32:50.289 Error: mapper: _plugin.onStart()
2024-08-04 13:32:50.289 Error: mapper: File "/opt/domoticz/userdata/plugins/MqttMapper/plugin.py", line 275, in onStart
2024-08-04 13:32:50.289 Error: mapper: for node in self.jsonData.items():
2024-08-04 13:32:50.289 Error: mapper: AttributeError: 'list' object has no attribute 'items' /code]

I have used several editors and every time i get a different outcome.
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest