Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with mycroft #87

Open
sesma24 opened this issue Feb 27, 2020 · 2 comments
Open

Problems with mycroft #87

sesma24 opened this issue Feb 27, 2020 · 2 comments

Comments

@sesma24
Copy link

sesma24 commented Feb 27, 2020

I am trying to work with the mycroft suite together with openhab and I am trying to use irtrans devices. For the operation of these, it appears to me in the openhab documentation that I need items of type string, however when entering an item of that type mycroft does not detect it as an item when listing the available items. Would there be any possible solution to work with this convention?

@mortommy
Copy link
Collaborator

mortommy commented Apr 7, 2020

Hi,
I had that kind of request before. it's a problem of not real natural language. In that case you can use a proxy item, when that item is triggered (by a vocal command) another one can be triggered to send the string command to your device.

@FloatingBoater
Copy link

Hi,

The proxy item technique works well to trigger any device, or even a whole set of states such as to turn many devices off last thing at night.

Here's my example from working code which is triggered with 'Hey Mycroft, turn Good Night ON' :

Define a proxy switch item:

Switch	GoodNight		"Good Night [%s]"	["Switchable"]

Then create a rule which triggers on the proxy being turned ON by Mycroft, then turns itself off:

rule "GoodNight Scene"
when
	// only supports ON, not OFF. Self-resets back to OFF.
	Item GoodNight changed to ON
then
	logInfo("GoodNight", "Rule entry...")
	logInfo("GoodNight", "State: " + GoodNight.state.toString())

	// ls /etc/openhab2/sounds/
	//playSound("alert.mp3")

       // add your Item code here to trigger IPTrans

	// reset state ready for the next ON without triggering actions
	// https://www.openhab.org/docs/configuration/rules-dsl.html#manipulating-item-states
	GoodNight.postUpdate(OFF)

	logInfo("GoodNight", "Rule exit...")
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants