Hi,
I cant seem to get tuyalocal to run though yaml.
If i go though the integration screen and use the GUI i can add my device but i have a lot of devices to add and would much rather use yaml. If I try to add a device though yaml home assistant says my config is valid but once home assistant has restarted I have no switch or any errors as far as i can tell. The sensors I have listed do get added but have a state of “Unavailable”.
What am I doing wrong? Is my config incorrect?
I installed tuyalocal by cloning GitHub - rospogrigio/localtuya: local handling for Tuya devices to my custom custom_components folder.
switch:
- platform: localtuya
host: x.x.x.x
local_key: "xxx"
device_id: "xxx"
name: tuya_g4
friendly_name: tuya_g4
protocol_version: 3.3
switches:
sw01:
name: tuya_g4
friendly_name: G4 plug
id: 1
current: 18
current_consumption: 19
voltage: 20
sensor:
- platform: template
sensors:
tuya_g4_voltage:
friendly_name: "G4 voltage"
unit_of_measurement: "V"
value_template: "{{ states.switch.tuya_g4.attributes.voltage }}"
tuya_g4_current:
friendly_name: "G4 current"
unit_of_measurement: "mA"
value_template: "{{ states.switch.tuya_g4.attributes.current }}"
tuya_g4_current_consumption:
friendly_name: "G4 current consumption"
unit_of_measurement: "W"
value_template: "{{ states.switch.tuya_g4.attributes.current_consumption }}"