Questions tagged [shelly]

Shelly is a small Haskell library to support scripting tasks.

Shelly is a Haskell library to support writing scripts in Haskell that would normally be written in Bash or some other scripting language. It provides functions for basic shell commands such as pwd, cd, mv, etc. as well as environment access.

Shelly commands must be run in the ShIO monad which is sandboxed so that each instance of the monad is thread safe.

17 questions
4
votes
3 answers

QSem doesn't seem to block threads

I'm writing a simple script to run bunch of tasks in parallel using the Shelly library but I want to limit the max number of tasks running at any one time. The script takes a file with an input on each line and runs a task for that input. There…
asm
  • 8,758
  • 3
  • 27
  • 48
3
votes
2 answers

Shelly: Convert String to Shelly FilePath

I need to execute the cp_r function from the Shelly library to copy a to b. However, import Shelly main = do cp_r "a" "b" yields Couldn't match expected type `Shelly.FilePath' with actual type `[Char]' In the first argument of `cp_r',…
Uli Köhler
  • 13,012
  • 16
  • 70
  • 120
3
votes
0 answers

Why is main executable busy when calling external executable with Shelly.Background

I am trying to write a program with Shelly to compile Delphi projects in parallel. I thought the program would be blocked while waiting for the Delphi compilers to return. But my program starts to max out one CPU-core after compiled 2 projects. I…
ePak
  • 484
  • 5
  • 12
2
votes
0 answers

Integrate between Shelly and Telegram via Webhook

I have tried to integrate between Shelly and Telegram. In Telegram there is an option called webhook that mean , if Telegram bot received an message that message will automatically move to another server : To open my Shelly relay I can send a POST (…
vtable
  • 302
  • 2
  • 15
2
votes
0 answers

Run a command via ssh with Shelly/Turtle

Given a command: ssh user@host command where command, when executed on the remote host host, should be: somecmd --option1 'option value with spaces' 'arg1 with spaces' 'arg2 with weird chars, like (' How can I execute this command using the…
Incömplete
  • 853
  • 8
  • 20
1
vote
0 answers

Turn on shelly with authentication via script

Shelly Plus 1 PM should turn on Shelly 1 that is protected with username and password. I have a Shelly Plus 1 PM running a script. At some point another Shelly 1 should be turned on for 10 seconds. As long as the Shelly 1 is not protected with…
n11f
  • 11
  • 2
1
vote
1 answer

Noob Question: How do I access this value in JavaScript?

I've never used JavaScript before and I'm stumped about how to access a particular value in an Object. The JSON looks like this: { "payload":{ "params":{ "switch:0":{ "output":false, **<= trying to get this value…
CharlieATX
  • 43
  • 4
1
vote
0 answers

How to write a Haskell program that initiates and can then run commands in a nix-shell environment?

I would like to initiate a nix-shell (if unfamiliar with Nix), this can be thought of as a bashs hell that loads a particular environment, somewhat expensively). Once initiated as a separate process, I'd like to be able to send commands to that…
bbarker
  • 11,636
  • 9
  • 38
  • 62
1
vote
1 answer

Haskell Shelly sample code

I'm trying to figure out how to use the Shelly (Shell.Pipe) library. So far i've got: {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExtendedDefaultRules #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} import Control.Applicative import…
McBear Holden
  • 5,741
  • 7
  • 33
  • 55
0
votes
1 answer

Script for Shelly Pro 2PM that overwrites a schedule

I am trying to create a script for Shelly Pro 2PM that overwrites the following schedule: if (sunrise +15min) > 5am : Turn on @5am, Turn off @ (sunrise +15min), else: do not turn on @5am if (sunset -15min) < 7pm : Turn on @ (sunset -…
0
votes
1 answer

Telegraf config for shelly3em/status

I am collecting power consumption data using a shelly 3EM. I don't like the MQTT approach, as this disables the cloud data feature. Thus, I want to connect to the shelly "status" endpoint using telegraph [[inputs.html]] plugin. The json from…
WolfiG
  • 1,059
  • 14
  • 31
0
votes
0 answers

influxdb flux query for mqtt sensors

I've some Shelly EM sensors flushing data into InfluxDb. I've this graph for the consumptions over time made by this query: from(bucket: "shelly-em") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement…
Leonardo Bernardini
  • 1,076
  • 13
  • 23
0
votes
1 answer

Shelly Plug S with iobroker per MQTT no Acknowledged when Relay0.Switch is changed

if i set switch from false to true the relais switches on but the state of the switch will reset back to false after few seconds. To switch the relais off via iobroker i have to switch it on and off immediately after in the timeframe were switch is…
Roli
  • 1
  • 5
0
votes
1 answer

Sending request with scriptable app to Shelly cloud

After connecting and wiring the Shelly2.5 with my shutter, trying to connect it with Siri. Decided to do this with Scriptable app and then connect Siri commands to it, so it will run. Currently have an issue to send the request from the Scriptable…
hod caspi
  • 826
  • 2
  • 10
  • 17
0
votes
1 answer

MQTT Error BR_ERR_BAD_VERSION on Shelly 1PM with Tasmota

I try to connect a Shelly 1 PM smart power relay to a managed MQTT broker. The firmware on the device is a custom-built Tasmota 8.3.1 from the dev branch with USE_MQTT_TLS enabled. The port is set correctly to 8883 for TLS and the broker service is…
mhaller
  • 14,122
  • 1
  • 42
  • 61
1
2