Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Nodo

Pages: [1] 2
1
"Open air" and "whole home" microphones / Re: How to interface with TcpMic?
« on: February 27, 2016, 09:14:20 AM »
I sent you a PM.

Thank you. Totally appreciated :)

2
"Open air" and "whole home" microphones / Re: How to interface with TcpMic?
« on: February 25, 2016, 03:09:19 PM »
Hi roel_v

I am happy to send you the source code for the TCP-Mic plugin.  It should help you even if you don't decide to modify it.  In theory it should be able to handle multiple simultaneous inputs but for some reason it does not and I haven't spent the time to troubleshoot it, but it can accept multiple inputs from different devices as long as they don't overlap.   Originally VoxWav and the TcpMic plugin were not designed for always on open air use.  The idea was to press a button or tilt your phone when you wanted to speak and that is still how I use it.  If you do want to do an always on solution you will still need to decide when to start and stop streaming audio to the plugin.  This could be done using volume levels which is how VoxWav does it, or if you are able to use basic speech recognition on the pi you could use a keyword or phrase to tell it when you want to give a command.  So although VoxWav can process multiple voice commands in a single longer sound stream, that stream must be of finite length, it can't just send continuously or it will never be processed and will just fill up the buffer.

Good day James,

I totally understand that this topic has not been active for a long time. But I thought that instead of starting a new thread I should try here first :).

I have to say that the amount of effort in coding all the  pieces and plugins is amazing and if you do not mind, I was trying to better understand the tcpMic plugin and I found this thread and I couldn`t help but ask for the source code since it would help me decide whether or not to try a Raspberry Pi daemon. With all honesty socket programming is quite a nightmare :).

Keep up the great work,
Nodo     

3
Integration Ideas / Re: Tutorial: Integrating VC with DomoticZ
« on: December 06, 2015, 07:34:39 AM »
Reserved

4
Integration Ideas / Tutorial: Integrating VC with DomoticZ
« on: December 06, 2015, 07:21:37 AM »
Good day,

In this integration tutorial between VC and the awesome free and open source home automation tool "DomoticZ" I will try to start from basic use to more advanced options.
We are going to assume that your DomoticZ setup is working flawlessly and that all you need is to integrate your existing DomoticZ setup with VC.

First off, the documentation references we should consult are:
1- DomoticZ API https://www.domoticz.com/wiki/Domoticz_API/JSON_URL's

[Will add more references once the tutorial is complete]

This tutorial will be divided into three parts:
Part One: Preparing all the information we will later need.
Part Two: Sending commands to DomoticZ.
Part Three: Getting information from DomoticZ.

Part One - Preparing Info

In this part we will be preparing all the information we need for sending/receiving commands to/from DomoticZ.

1- DomoticZ server`s IP address: if DomoticZ is on the same machine as VC you can safely use the IP mentioned below. Else, if DomoticZ is on a different machine, you would need the IP of that machine on your LAN.
Code: [Select]
DomoticZ IP = 127.0.0.1
2- DomoticZ webserver`s port: By default, the port is "8080".

3- (Optional) DomoticZ username and password: If you already specified username and password for DomoticZ.

4- Specific Switch IDx: Each switch in DomoticZ has its own unique ID, to get this unique ID:
  • Open your browser and go to http://127.0.0.1:8080
  • Enter username and password, if prompted.
  • Click Setup -> Devices
  • In the Devices table, identify the "Name" and "idx" columns as identified in the image below.


Now, we know that the switch "testSwitch" has an idx of 15.


Part Two - Sending Commands to DomoticZ

The most basic feature is to be able to send commands to DomoticZ to turn a switch on/off.

To test this out on the testSwitch we dealt with earlier to turn that switch "on", we need to open our browser and type:
Code: [Select]
http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx=15&switchcmd=On
The format for this command is as follows:
Code: [Select]
http://(IP Address):(Port)/json.htm?type=command&param=switchlight&idx=(Switch ID)&switchcmd=On
Okay, what if we have setup a username and password for DomoticZ server ?

In this case we change the format to:
Code: [Select]
http://username:password@127.0.0.1:8080/json.htm?type=command&param=switchlight&idx=15&switchcmd=On
If you noticed at the end of this url after the idx part, we have a
Code: [Select]
switchcmd=On
All we need to do to turn this switch off is to replace "On" by "off" as follows:
Code: [Select]
http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx=15&switchcmd=Off
Now that we`ve verified that we can communicate with DomoticZ, it is time to finalize this part integrating what we have learnt with VC.


All we need to do in VC is a "scrape" action in a command group with the phrase of our choice, in the following code snippet, the phrase used is "Turn On Test Switch" to turn on the switch and "Turn Off Test Switch" to turn it off.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<commandGroup open="True" name="DomoticZ" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="261" name="Turn Switch On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx=15&switchcmd=On</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Turn On test Switch</phrase>
  </command>
  <command id="278" name="Turn Switch Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx=15&switchcmd=Off</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Turn off test Switch</phrase>
  </command>
</commandGroup>
 

All you need to change in that code is the "idx" of the switch you want to turn on/off and of course the phrase needed.

Simply clone these commands to add more switches and change "idx" and the phrase to trigger the different commands.

In the next part we will go through more advanced topics about automating the process of getting device IDs and getting information from DomoticZ in a way that VC understands.

Hope this tutorial was easy to follow and stay tuned for the final part :).

5
Thank you nime5ter. Somehow passing a variable as a parameter totally slipped my mind. I guess multi-tasking, working long hours and coffee are a bad combination :).

Thank you again for being a great help.


6
Great explanation, nime5ter. Thank you :)

I was wondering how to get a variable from within a python file. I assumed (I might be wrong) that I should use
Code: [Select]
vc.getObject("Var.Example","") I also tried omitting "Var." but I can`t get it to work. Obviously I am doing something wrong.

 

7
Feature Requests / Re: Sending Gmail Attachments
« on: June 16, 2015, 02:32:03 PM »
Exactly :).

I just thought to mention this to benefit others who might come across the same issue.

Thank you again for your help, James.

8
Feature Requests / Re: Sending Gmail Attachments
« on: June 16, 2015, 01:08:02 PM »
I have added support for sending attachments with the SMTP.Send action.

It will be included in the next release, but it might take a couple of weeks for me to release it.

Thank you so much for adding it. Totally appreciated.

9
Feature Requests / Re: Sending Gmail Attachments
« on: June 16, 2015, 01:05:30 PM »
Hi James,

Thank you so much for the information and the link. I tried a couple of alternatives just like this one and I got one working after disabling "Modern Security Standards" configuration in my Gmail account.

I remember what Google did with their calendar and Translate and even Speech. One more reason to hate Google :).

I really do hate to bring this up but I have to mention that for all new Gmail accounts; the current SMTP will not work and will give back this message in the log (I do not know if the same applies for old accounts that never used SMTP before or not).
Quote
Action ERROR: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at

That is because the current SMTP uses SSL/TLS to communicate with Gmail and Gmail will block all third party authentications that do not use Oauth 2.0 unless "Less Secure Apps" is enabled in Gmail`s configurations.

I hope this helps other members running through that problem if they tried to send an e-mail using SMTP.

I will try to use Gmail`s python API and see what I can come up with.

10
Feature Requests / Sending Gmail Attachments
« on: June 16, 2015, 10:51:46 AM »
Good day James,

My objective here is to send an e-mail with an attachment using a Gmail account.

I understand that to send an e-mail I am to set up my username and password in Options and then use SMTP actions. But then I am unable to send attachments with the e-mail. That is the first part of the problem.

The second part is, Gmail for almost a year now started using what they call "Modern Security Standards" which is their fancy way of saying that they now use oauth 2.0 authorization ". To solve this, we have to use Gmail api with oauth functions to get around it or if not possible then to configure the Gmail account enabling "Less Secure Apps" so that we can use SMTP with SSL/TLS.

I have been considering writing my own implementation of Gmail`s api with Gmail library for python. But I noticed Gmail actions in VC and it got me thinking that if VC is already using Gmail`s API for Gmail actions ("GetAllSummeries","GetAllTitles","GetCount", etc) then it would be much easier to implement this directly with more actions to enable sending an email.

My question is should I write my own code using Gmail`s API or should I wait for Gmail actions to have a "send" action with attachment ?

The reason why I am asking is because I know you already have a lot on your plate lately and I do not want to bother you with more  :).

 


11
Other Plugins / Re: Domoticz Home Automation and VC
« on: June 06, 2015, 09:42:51 AM »
James, sorry for bringing back an old topic but I thought since I want to mention a potential bug, I should not post that in a topic of its own :). I only am mentioning this point since you kindly let me know before that you prefer to know about bugs.

Also, since this topic was about Maps, I hope I am not off topic.

The thing is, when I try to add subset matching when using Map.ExportPayloadXML, I noticed something weird. subset matching only works if and only if "key>>value" is set to "true".

Is there something I am doing wrong, or is this indeed a bug ?

12
Feature Requests / Extending Watcher Plugin
« on: June 02, 2015, 11:49:42 PM »
Good day,

I have been experimenting with VC for a long time now and I must apologize for not being active on the forum :).

@James: great updates to VC. VC keeps proving that it is such a valuable tool in home automation. Even though I know you do not need the compliments... but as a programmer I know that it does not hurt to know that your work is appreciated from time to time ;).

@nime5ter: Well done on the excellent support, tutorials and innovative ideas to integerate VC with other tools.

With that being said, I have been experimenting with the watcher plugin recently and I know that you have been busy with all the updates that you have no time for the watcher plugin, but I thought to throw my request out there.

I think the watcher plugin can be a great plugin if it was a bit dynamic (i.e. being able to assign a folder to the watcher plugin through a command with a payload). If that is quite hard to implement I think the next best option is to have a check box to enable watching "Subdirectories" at the plugin interface.

Also, another set of Watch plugin commands to enable and disable the plugin would be nice but I think this is a bit of a lower priority and it can be worked around for the time being.

Thank you again for the great tool and just to let you know I plan on purchasing VC once my setup is complete and I move to my new place.


13
Happy belated Birthday, James  :)

And Naomi, Hope the surprise went as you planned.

Wish you guys all the best ;) 

14
Other Plugins / Re: Domoticz Home Automation and VC
« on: March 07, 2014, 10:05:07 AM »
hmmm.  Looks like there might be a bug with trying to access multiple map entries within a single action.  I guess it has never come up before.  Should be fixable though.  Thanks for discovering it.

Thank you for taking the time to look into it, James, and sorry for adding that to your to-do list which I assume must be huge working on Alpha/Beta version 2 of VC :).

15
Other Plugins / Re: Domoticz Home Automation and VC
« on: March 06, 2014, 01:13:53 PM »
Thank you nime5ter.. I totally understand and I truly appreciate your time and effort developing VC or your support here on the forum.

I attached my log file and hopefully it would by helpful.

Pages: [1] 2