Current, voltage, and current consumption appear as attributes of the switch.
Works fine for me with this code in configuration.yaml.
DPS [1] VALUE [True]
DPS [9] VALUE [0]
DPS [18] VALUE [32] - Š”urrent
DPS [19] VALUE [32] - Power
DPS [20] VALUE [2367] - Voltage
DPS [21] VALUE [1]
DPS [22] VALUE [691]
DPS [23] VALUE [33766]
DPS [24] VALUE [20628]
DPS [25] VALUE [2030]
DPS [26] VALUE [0]
DPS [38] VALUE [memory] - Relay Status [off; on; memory]
DPS [40] VALUE [relay]
DPS [41] VALUE [False] - Lock
DPS [42] VALUE []
DPS [43] VALUE []
DPS [44] VALUE []
- host: 192.168.1."""
device_id: """""""""""""""
local_key: """"""""""""""""
friendly_name: Computer socket local tuya
protocol_version: "3.3"
scan_interval: 15
entities:
- platform: switch
friendly_name: Computer socket local tuya
id: 1
current: 18
current_consumption: 19
voltage: 20
- platform: sensor
friendly_name: Current Computer socket local tuya
id: 18
scaling: 0.001
device_class: current
unit_of_measurement: "A"
- platform: sensor
friendly_name: Power Computer socket local tuya
id: 19
scaling: 0.1
device_class: power
unit_of_measurement: "W"
- platform: sensor
friendly_name: Voltage Computer socket local tuya
id: 20
scaling: 0.1
device_class: voltage
unit_of_measurement: "V"
- platform: select
friendly_name: Relay Status
id: 38
select_options: off; on; memory
select_options_friendly: OFF; ON; Remember last status
- platform: switch
friendly_name: Child Lock
id: 41
You have to add, again under āintegrationsā ā¦choose Local_Tuya find the device in the dropdownlist, click add, then add sensor , choose 18 and add, then same last steps for 19 and 20 (add sensor choose 19, then 20), then you get them ass individual sensors( find them in entities-list after), beside the āviewā (attributes) you have under the Switch
Hi,
I would like to integrate a Smartlife Aromatherapy Machine, but I donāt know how to integrate it.
It has both the ignition switch, the possibility of varying the humidifier (normal / large), varying the color of the LED, switching on 1h, 3h, 6h.
In tuya IOT it is identified as:
ācategory_nameā: āHumidifierā,
āmodelā: ā13Kā,
āproduct_nameā: āAromatherapy machineā
Has anyone managed to integrate it?
Do you have any information about this questions? Iāve same question
Hi,
How can i add second host? I have 3 smart plug
Scroll just 3 posts upwards of yours ā¦
May I ask how you setup the EP2ās with Local Tuya?
I have a PR for better Fan support; I am using it with a REPHO air filter.
The current code assumes all sensors are numbers, and will do stack dumps on everything else.. .
Same issue for me. Is there any update?
Itās not worked for me. Is it still working for you?
Just go to intgreations and use local-tuya
I asked in the Local Tuya github repo if itās possible to add other scaling factors different from 0.1? E.G. 0.01, 0.001, etc. in the UI config flow.
At the moment only the 0.1 value is possible:
This limitation forces to have mA instead of A in current values and Wh instead of KWh in energy readings:
Adding my experience. I too acquired the Gosund SP1 hoping for ESP but sadly it was the RT chip so āforcedā to use localtuya, which creates the switch and its attributes. Then I created a template sensor to have the āstateā current_consumption and also added a intergation sensor based on the previous to create the statistics. Clearly horrible to have 3 entries to get to the Energy dashboard but it is as it is.
- platform: template
sensors:
gosund_1_consumption:
friendly_name: "GosundPlug1 current consumption"
unit_of_measurement: 'W'
device_class: power
value_template: "{{ states.switch.gosundplug1.attributes.current_consumption }}"
- platform: integration
source: sensor.gosund_1_consumption
name: gosund_plug_1
method: left
round: 2
unit_prefix: k
Im not sure about your specific Device, but All my devices in Local-Tuya, i had to Click again, on ADD-Integration, choose Local-Tuya ( and in the drop-down, choose the specific Device ) Then You Choose, Other than ID_1, (if you click the drop-down there, you should choose āSensorā) then you should get another dropdown, with atleast ID_18,ID_19,ID_20) ā¦ (dont forget to āuncheckā the little box, to be able to continue adding IDās, otherwise you have to choose ADD Integration again ( a little ānotā intuitive interface, and if you do/choose wrong , you have to start from scratch again(no go back, and change)
PS: You actually donāt have to choose , to have these 3 as Attributes
In Tuya.iot you can get a complete spec. on your Devices, with all itās āoptions/settingsā as which IDās it have, and which scale you should use(cording to themā¦ not always right)(i.e scale 1 == scaling-factor 0.1
Work for for my Nedis and Deltaco devices, but again i donāt know about Gosund
You can use what ever you like, just type i.e. 0.001 in text-editor, then copy-paste to overwrite 0.1
Yesā¦ localtuya creates the main switch, indiviaulaly/manually
Added (!) to that, the two I mentioned above.I was hoping to just create the āintegrationā one on top of localtuya but I seem to need the ātemplateā to get the consumption data into state-valueā¦allowing the āintegrationā to create statistics
So
switch.gosundplug (localtuya) => sensor.gosundplug_consumption (template) <+sensor.gosundplug_stats(integration)
Yes, either a template-sensor, or āaddingā the specific Sensor in Tuya-Integration ( either way, another sensor) , to base the statistic-sensor ācalculationā on
text not finished but just to be clear: you too need 3 (!) entities ?