-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create shellypro3em63.js * Update for Shelly Pro 3 EM63 * Update for Shelly Pro 3EM63 Temperaturesensor
- Loading branch information
Showing
3 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3453,7 +3453,97 @@ function addRGBW(deviceObj, rgbwId) { | |
}, | ||
}; | ||
} | ||
/** | ||
Check warning on line 3456 in lib/devices/gen2-helper.js
|
||
* Adds a generic Temp-Sensor definition for Shelly Pro3EM63 devices | ||
* | ||
* The following states are added: | ||
* - EM63 Temperature in °C and °F | ||
*/ | ||
function addEMTemperatureSensor(deviceObj) { | ||
deviceObj[`EMTemperature.tC`] = { | ||
mqtt: { | ||
http_publish: `/rpc/Temperature.GetStatus?id=0`, | ||
http_publish_funct: value => (value ? parseInt(JSON.parse(value).tC) : undefined), | ||
}, | ||
common: { | ||
name: { | ||
en: 'Temperature', | ||
de: 'Temperatur', | ||
ru: 'Температура', | ||
pt: 'Temperatura', | ||
nl: 'Temperatuur', | ||
fr: 'Température', | ||
it: 'Temperatura', | ||
es: 'Temperatura', | ||
pl: 'Temperatura', | ||
'zh-cn': '模范', | ||
}, | ||
type: 'number', | ||
role: 'value.temperature', | ||
read: true, | ||
write: false, | ||
unit: '°C', | ||
}, | ||
}; | ||
deviceObj[`EMTemperature.tF`] = { | ||
mqtt: { | ||
http_publish: `/rpc/Temperature.GetStatus?id=0`, | ||
http_publish_funct: value => (value ? parseInt(JSON.parse(value).tF) : undefined), | ||
}, | ||
common: { | ||
name: { | ||
en: 'Temperature', | ||
de: 'Temperatur', | ||
ru: 'Температура', | ||
pt: 'Temperatura', | ||
nl: 'Temperatuur', | ||
fr: 'Température', | ||
it: 'Temperatura', | ||
es: 'Temperatura', | ||
pl: 'Temperatura', | ||
'zh-cn': '模范', | ||
}, | ||
type: 'number', | ||
role: 'value.temperature', | ||
read: true, | ||
write: false, | ||
unit: '°F', | ||
}, | ||
}; | ||
deviceObj[`EMTemperature.ReportThreshold`] = { | ||
mqtt: { | ||
http_publish: `/rpc/Temperature.GetConfig?id=0`, | ||
http_publish_funct: value => (value ? (JSON.parse(value).report_thr_C) : undefined), | ||
}, | ||
common: { | ||
name: { | ||
en: 'Threshold', | ||
}, | ||
type: 'number', | ||
role: 'value.temperature', | ||
read: true, | ||
write: false, | ||
unit: '°C', | ||
}, | ||
}; | ||
deviceObj[`EMTemperature.Offset`] = { | ||
mqtt: { | ||
http_publish: `/rpc/Temperature.GetConfig?id=0`, | ||
http_publish_funct: value => (value ? (JSON.parse(value).offset_C) : undefined), | ||
}, | ||
common: { | ||
name: { | ||
en: 'Offset', | ||
}, | ||
type: 'number', | ||
role: 'value.temperature', | ||
read: true, | ||
write: false, | ||
unit: '°C', | ||
}, | ||
|
||
}; | ||
} | ||
module.exports = { | ||
addEM1, | ||
addPM1, | ||
|
@@ -3471,4 +3561,5 @@ module.exports = { | |
addProOutputAddon, | ||
addRGB, | ||
addRGBW, | ||
addEMTemperatureSensor, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
const shellyHelperGen2 = require('../gen2-helper'); | ||
|
||
/** | ||
* Shelly Pro 3 EM / shellypro3em63 | ||
* | ||
* https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyPro3EM | ||
*/ | ||
const shellypro3em63 = {}; | ||
|
||
shellyHelperGen2.addEnergyMeter(shellypro3em63, 0, ['a', 'b', 'c']); | ||
shellyHelperGen2.addEnergyMeterData(shellypro3em63, 0, ['a', 'b', 'c']); | ||
shellyHelperGen2.addEMTemperatureSensor(shellypro3em63); | ||
shellyHelperGen2.addProOutputAddon(shellypro3em63); | ||
|
||
module.exports = { | ||
shellypro3em63, | ||
}; |