• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pilight voice commands
#1
You can control devices via pilight using voice commands.
You need:
pilight apk - https://play.google.com/store/apps/detai...ight&hl=pl
Tasker apk - https://play.google.com/store/apps/detai...kerm&hl=pl
Autovoice apk - https://play.google.com/store/apps/detai...lock&hl=pl
 
Reply
#2
AutoVoice, Tasker und pilight make an awesome team!

But I personally didn't like the pilight app you mentioned. It's kind of slow and needs a service for the connection to pilight.

Instead I made a task that takes the device as argument, gets the config via http://<webgui>/config, parses the JSON with a two line javascriptlet to get the current state and puts it in the inversed state via the REST api:

Code:
pilight Toggle (84)
A1: Variable Set [ Name:%pl_device To:%par1 Do Maths:Off Append:Off ]
A2: HTTP Get [ Server:Port:http://raspi:5001 Path:config Attributes: Cookies: User Agent: Timeout:10 Mime Type: Output File: Trust Any Certificate:Off ]
A3: JavaScriptlet [ Code:var cfg = JSON.parse(global("HTTPD"));
var state = cfg.devices[pl_device].state Libraries: Auto Exit:On Timeout (Seconds):45 ]
A4: If [ %state eq off ]
A5: HTTP Get [ Server:Port:http://raspi:5001 Path:control Attributes:device=%pl_device
state=on Cookies: User Agent: Timeout:10 Mime Type: Output File: Trust Any Certificate:Off ]
A6: Else If [ %state ~ on ]
A7: HTTP Get [ Server:Port:http://raspi:5001 Path:control Attributes:device=%pl_device
state=off Cookies: User Agent: Timeout:10 Mime Type: Output File: Trust Any Certificate:Off ]
A8: Else If [ %state ~ stopped ]
A9: HTTP Get [ Server:Port:http://raspi:5001 Path:control Attributes:device=%pl_device
state=running Cookies: User Agent: Timeout:10 Mime Type: Output File: Trust Any Certificate:Off ]
A10: Else If [ %state ~ running ]
A11: HTTP Get [ Server:Port:http://raspi:5001 Path:control Attributes:device=%pl_device
state=stopped Cookies: User Agent: Timeout:10 Mime Type: Output File: Trust Any Certificate:Off ]
A12: End If

Works for switches an programs. You call it with Perform Task and the device as %par1.

As it toggles it's much more flexible for voice commands. Having only sofa as the keyword for example I can say
  • Turn the sofa light on.
  • Let me have some light on the sofa.
  • I want to read on the sofa.
  • It's too damn dark on the sofa.
  • I don't need the sofa light any more.
  • Leaving the sofa.
  • Sofa.
  • ...
Makes the whole thing seem like an AI. Cool
 
Reply
#3
Hi,

could you please explain more detailed how you create the whole task in tasker. For example: What is the categorie i have to choose?

Thanks!!
 
Reply
#4
Hi Jurkla,

the export export I posted in the box above is very detailed I'd say. Tongue For example A1 is the first action in the task: Variable Set. If you don't know where to find it just use the filter box underneath the category selection for a new action.

I'd generally recommend to have Tasker set to English even if it's not you mother tongue.

Does that help?
 
Reply
#5
I read it and in general I do not know what it is.
Write a short tutorial on how it looks, step by step
 
Reply
#6
What you see above is a Tasker description export of the toggle task I use. It describes the 12 actions (A1 to A12) I added to the task. Every one of them is covered with action name as well as complete settings in the following way:
Code:
A<number>: <action name> [ <action setting 1 name>:<action setting 1 value> <action setting 2 name>:<action setting 2 value> ... ]
I'm confident you're able to understand it if you tried and already used Tasker. It might help setting Tasker to English as I already said. And you might need to disable beginner mode.

If there are any specific questions I'm honestly happy to help. But I'm sorry I won't write a complete Tasker guide. That's definitely out of scope and there is plenty information out there.
 
Reply
#7
Can you export the settings tasker and send me on priv?
 
Reply
#8
The task as XML instead of as description you mean?
XML is not allowed as an attachment so here you go inline:
Code:
<TaskerData sr="" dvi="1" tv="4.8m">
    <Task sr="task84">
        <cdate>1453918856066</cdate>
        <edate>1454007164347</edate>
        <id>84</id>
        <nme>pilight Toggle</nme>
        <pri>100</pri>
        <Action sr="act0" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%pl_device</Str>
            <Str sr="arg1" ve="3">%par1</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act1" ve="7">
            <code>118</code>
            <Str sr="arg0" ve="3">http://raspi:5001</Str>
            <Str sr="arg1" ve="3">config</Str>
            <Str sr="arg2" ve="3"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Int sr="arg5" val="10"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Int sr="arg8" val="0"/>
        </Action>
        <Action sr="act10" ve="7">
            <code>118</code>
            <Str sr="arg0" ve="3">http://raspi:5001</Str>
            <Str sr="arg1" ve="3">control</Str>
            <Str sr="arg2" ve="3">device=%pl_device
state=stopped</Str>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Int sr="arg5" val="10"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Int sr="arg8" val="0"/>
        </Action>
        <Action sr="act11" ve="7">
            <code>38</code>
        </Action>
        <Action sr="act2" ve="7">
            <code>129</code>
            <Str sr="arg0" ve="3">var cfg = JSON.parse(global("HTTPD"));
var state = cfg.devices[pl_device].state</Str>
            <Str sr="arg1" ve="3"/>
            <Int sr="arg2" val="1"/>
            <Int sr="arg3" val="45"/>
        </Action>
        <Action sr="act3" ve="7">
            <code>37</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%state</lhs>
                    <op>0</op>
                    <rhs>off</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act4" ve="7">
            <code>118</code>
            <Str sr="arg0" ve="3">http://raspi:5001</Str>
            <Str sr="arg1" ve="3">control</Str>
            <Str sr="arg2" ve="3">device=%pl_device
state=on</Str>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Int sr="arg5" val="10"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Int sr="arg8" val="0"/>
        </Action>
        <Action sr="act5" ve="7">
            <code>43</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%state</lhs>
                    <op>2</op>
                    <rhs>on</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act6" ve="7">
            <code>118</code>
            <Str sr="arg0" ve="3">http://raspi:5001</Str>
            <Str sr="arg1" ve="3">control</Str>
            <Str sr="arg2" ve="3">device=%pl_device
state=off</Str>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Int sr="arg5" val="10"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Int sr="arg8" val="0"/>
        </Action>
        <Action sr="act7" ve="7">
            <code>43</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%state</lhs>
                    <op>2</op>
                    <rhs>stopped</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act8" ve="7">
            <code>118</code>
            <Str sr="arg0" ve="3">http://raspi:5001</Str>
            <Str sr="arg1" ve="3">control</Str>
            <Str sr="arg2" ve="3">device=%pl_device
state=running</Str>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Int sr="arg5" val="10"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Int sr="arg8" val="0"/>
        </Action>
        <Action sr="act9" ve="7">
            <code>43</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%state</lhs>
                    <op>2</op>
                    <rhs>running</rhs>
                </Condition>
            </ConditionList>
        </Action>
    </Task>
</TaskerData>
 
Reply
#9
I do not understand
Where do I have to enter my outlet?
 
Reply
#10
As I said in my first post:
(01-28-2016, 12:44 PM)sral Wrote: Works for switches an programs. You call it with Perform Task and the device as %par1.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Does piSchedule work with pilight 8.1.1-nightly Peter S 0 1,403 06-29-2018, 07:57 PM
Last Post: Peter S
  pilight-console - an LCD / keypad interface for pilight frenchie71 3 1,140 11-21-2017, 11:15 PM
Last Post: curlymo
  Connect pilight to your hue bridge hannemann 3 2,400 01-03-2017, 11:26 PM
Last Post: hannemann
Wink PHP class using pilight socket connection Dan 0 1,357 11-03-2016, 11:41 AM
Last Post: Dan
  piScheduler -- A pilight extension for the daily switch plan gneandr 159 59,930 08-09-2016, 04:33 PM
Last Post: gneandr
  Controlling a RGB Led Strip over pilight mightyuhu 2 2,266 08-06-2016, 09:10 PM
Last Post: JohannK
  HomeBridge with pilight on raspbian Jurre 10 10,735 04-06-2016, 07:45 AM
Last Post: tomtom
  Python Ping pilight detect mobilephone Cryptomaster 0 2,022 01-10-2016, 04:17 PM
Last Post: Cryptomaster
  pilight config editor ktams 16 7,372 01-06-2016, 02:42 PM
Last Post: ktams
  command processing between pilight and openhab royhofman1989 3 2,682 07-13-2015, 11:26 AM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)