I have built a "Tesla" screen in HSTouch and I want to be able to update the Tesla devices when I click on a button in HSTouch.
I see that the Status device has a status of "Waiting on Sleep" and a value of 4 and when i issue the "Update " command, after a short delay, the status changes to "Success" with a value of 1.
Do I need to issue the Update command to the Status device and then check for the Status value to change to 1 before I check the value of the Charge Port device?
I want to create a script that:
1. requests an update of tesla devices
2. Verifies the tesla devices update occurred
3 check for charge port closed
4. if closed, issue a voice command from homeseer that the charging cable is not plugged in.
I know the charge port device is a 1 when open and 0 when closed.
My question is what is the correct way to force an update of the tesla device, and verify the update occurred?
I don't think I can really do what I want with events and that I will need to write a script(i am a beginner). When I try the following two script commands, I always get a value of -1 for both devices instead of 0 or 1 for Charge Port and 1 or 4 for Status as I get from HSTouch:
hs.WriteLog("Tesla", "Charge Port = " & hs.DeviceValueByName("(MAS Dream Car) Charge Port" ))
hs.WriteLog("Tesla", "Status = " & hs.DeviceValueByName("(MAS Dream Car) Status" )) '(MAS Dream Car is the Room Name)
Any help would be much appreciated.
Thanks,
Wallis
I see that the Status device has a status of "Waiting on Sleep" and a value of 4 and when i issue the "Update " command, after a short delay, the status changes to "Success" with a value of 1.
Do I need to issue the Update command to the Status device and then check for the Status value to change to 1 before I check the value of the Charge Port device?
I want to create a script that:
1. requests an update of tesla devices
2. Verifies the tesla devices update occurred
3 check for charge port closed
4. if closed, issue a voice command from homeseer that the charging cable is not plugged in.
I know the charge port device is a 1 when open and 0 when closed.
My question is what is the correct way to force an update of the tesla device, and verify the update occurred?
I don't think I can really do what I want with events and that I will need to write a script(i am a beginner). When I try the following two script commands, I always get a value of -1 for both devices instead of 0 or 1 for Charge Port and 1 or 4 for Status as I get from HSTouch:
hs.WriteLog("Tesla", "Charge Port = " & hs.DeviceValueByName("(MAS Dream Car) Charge Port" ))
hs.WriteLog("Tesla", "Status = " & hs.DeviceValueByName("(MAS Dream Car) Status" )) '(MAS Dream Car is the Room Name)
Any help would be much appreciated.
Thanks,
Wallis
Comment