Author
Topic: Command Line System Queries (Read 1965 times)

I'm interested in something opposite of Messagesend. Is it possible to determine device status, or housemode, etc from the command-line?

One example of why I ask is that I have a doorbell event which launches a bash script and does a variety of different things:

1) If the user has simply pressed the doorbell that's one branch.2) If the user has pressed the doorbell in the correct morse-code sequence, the system gets disarmed.

A) If the housemode is armed or vacation, and 1 happens, the script sends an SMS message to myself and my wife saying that the doorbell was rung.B) If the housemode is unarmed, secure-at-home, or entertaining, and 1 happens, the script rings the doorbellC) If 2 happens, and the housemode was armed or vacation, the script sends an SMS to myself and my wife saying that the system was disarmed via the doorbell.D) If 2 happens, and the housemode was sleep, the script rings the doorbell.

I've created rather complicated logic within a bash script to log the times for which doorbell push and release events occur, and to interpret these as morse code.

I'd rather not have to create and manage a bunch of respond-to events within web-admin (with various criteria), and then re-use the Morse-code interpretation routine within each event. Preferable would be to have one doorbell push event, one doorbell release event, and then test the various criteria within the code.

I'm interested in something opposite of Messagesend. Is it possible to determine device status, or housemode, etc from the command-line?

One example of why I ask is that I have a doorbell event which launches a bash script and does a variety of different things:

1) If the user has simply pressed the doorbell that's one branch.2) If the user has pressed the doorbell in the correct morse-code sequence, the system gets disarmed.

A) If the housemode is armed or vacation, and 1 happens, the script sends an SMS message to myself and my wife saying that the doorbell was rung.B) If the housemode is unarmed, secure-at-home, or entertaining, and 1 happens, the script rings the doorbellC) If 2 happens, and the housemode was armed or vacation, the script sends an SMS to myself and my wife saying that the system was disarmed via the doorbell.D) If 2 happens, and the housemode was sleep, the script rings the doorbell.

I've created rather complicated logic within a bash script to log the times for which doorbell push and release events occur, and to interpret these as morse code.

I'd rather not have to create and manage a bunch of respond-to events within web-admin (with various criteria), and then re-use the Morse-code interpretation routine within each event. Preferable would be to have one doorbell push event, one doorbell release event, and then test the various criteria within the code.

Sorry for the drawn out explanation. Is this doable?

It's what scenarios and the advanced editor is for... its not a perfect environment to build this stuff in but it will in principle it will allow you to build this kind of logic. Give it a try.

I'm interested in something opposite of Messagesend. Is it possible to determine device status, or housemode, etc from the command-line?

I use messagesend to query device status. I don't have my system in front of me but messagesend can query device status and return a result that is easily parsed. I use it to check for the status of certain devices before acting on events.

I have found the advanced editor to be rather lacking in the ability to act based on the status or state of other devices. I'd love to have a way to do this with the advanced editor but I have had no luck myself.

I'm very interested to know how you use Messagesend to return device status. I looked in the wiki and it wasn't apparent to me. If you get a chance to check I'd be grateful to know how you accomplish this..

2) If the user has pressed the doorbell in the correct morse-code sequence, the system gets disarmed.

A word of caution- make sure the morse-code sequence for disarming the system and the one for detonating the short-range nuclear device are sufficiently different. It sounds silly to mention but it catches out the most experienced users from time to time.

A word of caution- make sure the morse-code sequence for disarming the system and the one for detonating the short-range nuclear device are sufficiently different. It sounds silly to mention but it catches out the most experienced users from time to time.

I don't have one of those, but I was hoping to have a sequence which initiates the conversion from "regular house" into sex-pad (giggidy-giggidy). I'll heed your advice, as it would be awkward bringing the in-laws into such an environment.

A word of caution- make sure the morse-code sequence for disarming the system and the one for detonating the short-range nuclear device are sufficiently different. It sounds silly to mention but it catches out the most experienced users from time to time.