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
