just tested work perfect thanks @Dunaar
I am having the exact same issue. Have you found a resolution yet?
Mine worked fine with Dunaar’s blueprint
I just connected the switch and I had the problem that I could choose the different triggers in automation but actually pressing the button did nothing.
This:
- Change the configuration of the switch : maintain the 2nd (top right) and 4th (bottom right) buttons together during several seconds until the 3rd button blinks
→ the behavior of the switch is changed and is now similar to the TS0044
→ the automation works now for the 12th configurations (4 buttons, 1-click, 2-click, long-press).
Fixed it for me. Thank you @Dunaar
I am confused. is it now working with 12 scenes? did you improved the original blueprint from this post or did you made the changes on the original one?
I am not sure how to import the blueprint with 12 scenes to my HA
Hi all,
I’ve just proposed and posted the content of the blueprint and haven’t change the original.
I’ve just wanted to share the setup that works for me.
If you want to use the blueprint, you can create a blueprint file zha-ts004f-tuya-4-button-blueprint.yaml
under the blueprints/automations
directory with the File Editor.
If someone is aware about to upgrade or to fork the original blueprint (I’ve never done that), it would be great he does.
Pay attention to do the step “Change the configuration of the switch : maintain the 2nd (top right) and 4th (bottom right) buttons together during several seconds until the 3rd button blinks” to be able to use the blueprint.
Awesome; did not know about the switch configuration!
Merci
Exactly the same issue on my side with 2 different TS004F (moes)
Thank you @Dunaar for this amazing hack! Just wondering how you discovered this magic of pressing buttons to change the switch behaviour … brilliant.
In any case, I’ve just updated the original post replacing the blueprint by the one you provided us.
And really sorry to all using this blueprint: I’ve just seen this answers now, as I got distracted by other issues (this switch draining battery, replacement of my HA server, …). Hope now things stay stable.
Converted the 12 button blueprint to Node Red flow.
To use it :
- Import the flow
- Change the device id in the Scene Switch node.
- Connect the end points to whatever you want it to do.
[
{
"id": "a332bce38a2178ce",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": "",
"env": []
},
{
"id": "4ff9b9ef99d85d91",
"type": "server-events",
"z": "a332bce38a2178ce",
"name": "zha_event_scanner",
"server": "76b07c6c.a5b7a4",
"version": 1,
"event_type": "zha_event",
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "$outputData(\"eventData\").event_type",
"valueType": "jsonata"
},
{
"property": "event_type",
"propertyType": "msg",
"value": "$outputData(\"eventData\").event_type",
"valueType": "jsonata"
}
],
"x": 110,
"y": 40,
"wires": [
[
"5d3abba8ca20c166"
]
]
},
{
"id": "5d3abba8ca20c166",
"type": "switch",
"z": "a332bce38a2178ce",
"name": "Scene Switch",
"property": "payload.event.device_ieee",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "60:a4:23:ff:fe:6b:75:4d",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 300,
"y": 40,
"wires": [
[
"c9f64ad0d0fbbf20"
]
]
},
{
"id": "c9f64ad0d0fbbf20",
"type": "switch",
"z": "a332bce38a2178ce",
"name": "Press Type",
"property": "payload.event.command",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "remote_button_short_press",
"vt": "str"
},
{
"t": "eq",
"v": "remote_button_double_press",
"vt": "str"
},
{
"t": "eq",
"v": "remote_button_long_press",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 470,
"y": 40,
"wires": [
[
"fd76a00401a2958b"
],
[
"efcb89c4f5193d48"
],
[
"bb278fa79e4e0026"
]
]
},
{
"id": "fd76a00401a2958b",
"type": "switch",
"z": "a332bce38a2178ce",
"name": "Short Press",
"property": "payload.event.endpoint_id",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "str"
},
{
"t": "eq",
"v": "2",
"vt": "str"
},
{
"t": "eq",
"v": "3",
"vt": "str"
},
{
"t": "eq",
"v": "4",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 690,
"y": 40,
"wires": [
[],
[],
[],
[]
]
},
{
"id": "efcb89c4f5193d48",
"type": "switch",
"z": "a332bce38a2178ce",
"name": "Double Press",
"property": "payload.event.endpoint_id",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "str"
},
{
"t": "eq",
"v": "2",
"vt": "str"
},
{
"t": "eq",
"v": "3",
"vt": "str"
},
{
"t": "eq",
"v": "4",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 700,
"y": 120,
"wires": [
[],
[],
[],
[]
]
},
{
"id": "bb278fa79e4e0026",
"type": "switch",
"z": "a332bce38a2178ce",
"name": "Long Press",
"property": "payload.event.endpoint_id",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "str"
},
{
"t": "eq",
"v": "2",
"vt": "str"
},
{
"t": "eq",
"v": "3",
"vt": "str"
},
{
"t": "eq",
"v": "4",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 690,
"y": 200,
"wires": [
[],
[],
[],
[]
]
},
{
"id": "76b07c6c.a5b7a4",
"type": "server",
"name": "Home Assistant",
"version": 2,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": "30"
}
]
Worked as advertised!!! Awesome and thank you. I like this button and was quite disappointed when it didn’t work.
I am getting an error every time I restart HA
Any Ideas?
Thanks
Logger: homeassistant.config
Source: components/blueprint/models.py:161
First occurred: June 20, 2022, 9:09:31 PM (1 occurrences)
Last logged: June 20, 2022, 9:09:31 PM
Invalid config for [automation]: Missing input tuya_4button_switch (See /config/configuration.yaml, line 8).
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 103, in _try_async_validate_config_item
config = await async_validate_config_item(hass, config, full_config)
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 70, in async_validate_config_item
return await blueprints.async_inputs_from_config(config)
File "/usr/src/homeassistant/homeassistant/components/blueprint/models.py", line 299, in async_inputs_from_config
inputs.validate()
File "/usr/src/homeassistant/homeassistant/components/blueprint/models.py", line 161, in validate
raise MissingInput(self.blueprint.domain, self.blueprint.name, missing)
homeassistant.components.blueprint.errors.MissingInput: Missing input tuya_4button_switch
I have the same. Did you manage to fix the error in the meantime?
I did everything from scratch.
Imported the blueprint, binded the switch, and created the automation.
Please pay attention to the state of the switch. Read the section under “Attention” in the 1st post.
Thank you for this Blueprint. I’m feeling a noob. I still can.t get the switch to dim up and down on long press. Any help?
Spent few hours trying to make TS004F work.
Finally found this post - changing the configuration of the switch SOLVED my problem.
THANK YOU!
Hi everyone
I might have encountered a bit of a weird Tuya TS004F.
From all I understand all devices in this threat have four distinct buttons.
Mine has two bottons with two positions (up + down) each.
I bought them here: https://de.aliexpress.com/item/1005006265612118.html
I can switch the mode when I press bottom-left + bottom-right (instead of top-right + bottom-right as recommended in the top post).
However: only the top right button is then still working.
All other buttons are not recognized in the log.
The top left button produces this two logs:
First: _TZ3000_0ht8dnxj TS004F Remote Button Short Press event was fired
Second: _TZ3000_0ht8dnxj TS004F Press Type event was fired with parameters: {‘press_type’: 0}
Double and Long press events are also present but still only for the top left.
Does somebody know what could be wrong?
Maybe I just have to bit the bullet and get some ugly Ikea Tradfri ones
Thank you for this blueprint, it’s got my button working nicely!
Just one problem - though it’s not a show stopper. We have several Tuya 4-button scene switches and due to the different hardware numbers this happened to be the only one of mine that required this Blueprint.
I find that to use it, we first have to press any button once to wake it and it goes through it’s “reconnecting” light flashes, and then accepts our next button press. There is no problem with its zigbee signal.
I used the press top and bottom right buttons hack and now for buttons 2, 3 & 4 I see:
- For button 2 - Remote Button Short Press - Button 2 event was fired
- For button 3 - Remote Button Short Press - Button 3 event was fired
- For button 4 - Remote Button Short Press - Button 4 event was fired
but for button 1 I see:
Press Type event was fired with parameters: {‘press_type’: 0}
How do I fix this for button 1 to be - Remote Button Short Press - Button 1 event was fired?
TY