You may find examples in this forum, looking for MqttMapper.
I may also help
Moderator: leecollings
Perhaps someone can gather all shelly MQTTMapper configs and put it in a topic or github repository.FlyingDomotic wrote: Friday 07 November 2025 10:50 Some people here did manage connecting Shellies to Domoticz through MqttMapper plug-in.
You may find examples in this forum, looking for MqttMapper.
I may also help![]()
oli80330 wrote: Saturday 25 October 2025 2:33 Json for sdhelly 2.5 roller works fine.
several JSON examples for shelly (1/2.5/EM Gen1) :
1 - For a Shelly 1 (GEN1) / domoticz device on/off :
"SDB Ventil": {
"topic": "shellies/SDB Ventil/relay/0",
"type": "244", "subtype": "73",
"switchtype": "0",
"mapping": {"item": "", "default": "0", "values": { "off": "0", "on": "100", "false": "0", "true": "100" }},
"commands": {
"On": {"topic": "shellies/SDB Ventil/relay/0/command", "payload": "on"},
"Off": {"topic": "shellies/SDB Ventil/relay/0/command", "payload": "off"}
}
2- For a Shelly 2.5 mode relay (not roller mode) (GEN1) / domoticz on/off :
"CE Mode PAC": {
"topic": "shellies/CE Thermo Solaire/relay/0",
"type": "244", "subtype": "73",
"switchtype": "0",
"mapping": {"item": "", "default": "0", "values": { "off": "0", "on": "100", "false": "0", "true": "100" }},
"commands": {
"On": {"topic": "shellies/CE Thermo Solaire/relay/0", "payload": "on"},
"Off": {"topic": "shellies/CE Thermo Solaire/relay/0", "payload": "off"}
}
}
3 -For a Shelly 2.5 mode roller (not relay mode) (GEN1) / domoticz blinds on/off/stop/position :
"ShellyMapper - Buro Volet": {
"topic": "shellies/Buro Volet/roller/0/pos",
"type": "244",
"subtype": "73",
"switchtype": "21",
"mapping": {"item": ""},
"commands": {
"Open": { "topic": "shellies/Buro Volet/roller/0/command", "payload": "open" },
"Close": { "topic": "shellies/Buro Volet/roller/0/command", "payload": "close" },
"Stop": { "topic": "shellies/Buro Volet/roller/0/command", "payload": "stop" },
"Set Level": { "topic": "shellies/Buro Volet/roller/0/command/pos", "payload": "<level>", "retain": false }
}
}
4 - For a Shelly EM or Shelly 2.5 (Gen1 conso) / domoticz General, kWh :
"Clim Salon": {
"topic": "shellies/Clim Salon/relay/0/power",
"type": "243", "subtype": "29", "switchtype": "0",
"options": {"EnergyMeterMode":"0"},
"mapping": {"item":"~*;~0"}
}
Thank you very much for your plugin, very fast for feedback in MQTT !
The CPU consumption of the RPi is very low.
A good plugin for shelly device, better than shellyteacher or AutoDiscovery, very slow in feedback.
Code: Select all
// Send Plug's Status & Power to Domoticz
let CONFIG = {
outputId: 0,
httpServer: 'http://1.8.1.1:8080', //Domoticz Server IP
httpState: '/json.htm?type=command¶m=switchlight&idx=6536&switchcmd=', // Domoticz Dummy Switch
httpPower: '/json.htm?type=command¶m=udevice&idx=6535&nvalue=0&svalue=' // Domoticz Dummy Power Device
};
function notifyState(OnOff) {
Shelly.call(
'HTTP.GET',
{url:CONFIG.httpServer+CONFIG.httpState+OnOff}
)
}
function notifyPower(Power, Energy) {
Shelly.call(
'HTTP.GET',
{url:CONFIG.httpServer+CONFIG.httpPower+Power+';'+Energy}
)
}
let outputStringId = "switch:" + JSON.stringify(CONFIG.outputId);
print(outputStringId);
Shelly.addStatusHandler(function (statusNtf) {
if (statusNtf.component !== outputStringId) return;
let sysStatus = Shelly.getComponentStatus('Switch:0')
if (sysStatus.output === true) notifyState('On');
else notifyState('Off');
notifyPower(sysStatus.apower, sysStatus.aenergy.total)
print(sysStatus.apower)
print(sysStatus.aenergy.total)
});Code: Select all
http://<Domoticz IPaddress>:<port>/json.htm?type=command¶m=switchlight&idx=<door contact idx>&switchcmd=OnReturning to this post by "Itschi,"Itschi wrote: Monday 17 November 2025 17:06 The most elegant way to integrate Shelly devices in Domoticz from my perspective is to make use of their integrated scripting function. Just add the respective dummy devices in Domoticz and a script in the Shelly device to call the Domoticz JSON interface. For a Plug S this looks like:
Finally you add in the Domoticz switch the on and off actions where 1.8.1.17 is the Shelly IP in this example:Code: Select all
// Send Plug's Status & Power to Domoticz let CONFIG = { outputId: 0, httpServer: 'http://1.8.1.1:8080', //Domoticz Server IP httpState: '/json.htm?type=command¶m=switchlight&idx=6536&switchcmd=', // Domoticz Dummy Switch httpPower: '/json.htm?type=command¶m=udevice&idx=6535&nvalue=0&svalue=' // Domoticz Dummy Power Device }; function notifyState(OnOff) { Shelly.call( 'HTTP.GET', {url:CONFIG.httpServer+CONFIG.httpState+OnOff} ) } function notifyPower(Power, Energy) { Shelly.call( 'HTTP.GET', {url:CONFIG.httpServer+CONFIG.httpPower+Power+';'+Energy} ) } let outputStringId = "switch:" + JSON.stringify(CONFIG.outputId); print(outputStringId); Shelly.addStatusHandler(function (statusNtf) { if (statusNtf.component !== outputStringId) return; let sysStatus = Shelly.getComponentStatus('Switch:0') if (sysStatus.output === true) notifyState('On'); else notifyState('Off'); notifyPower(sysStatus.apower, sysStatus.aenergy.total) print(sysStatus.apower) print(sysStatus.aenergy.total) });
"http://1.8.1.17/relay/0?turn=on"
"http://1.8.1.17/relay/0?turn=off"
That's it. Now you can control and monitor the plug from any endpoint (Domoticz, Shelly-App and even from the device switch).
Users browsing this forum: No registered users and 1 guest